1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
il63 [147K]
3 years ago
9

Retype the below code. Fix the indentation as necessary to make the program work. if 'New York' in temperatures: if temperatures

['New York'] > 90: print('The city is melting!') else: print('The temperature in New York is', temperatures['New York']) else: print('The temperature in New York is unknown.') Sample output with input: 105 The city is melting!
Engineering
1 answer:
adell [148]3 years ago
4 0

Answer: Here is the indented code:

if 'New York' in temperatures:

 if temperatures['New York'] > 90:

   print('The city is melting!')

 else:

   print('The temperature in New York is', temperatures['New York'])

else:

   print('The temperature in New York is unknown.')

Explanation:

Here is the complete program:

temperatures = {

   'Seattle': 56.5,

   'New York': 105,

   'Kansas City': 81.9,

   'Los Angeles': 76.5

}

if 'New York' in temperatures:

 if temperatures['New York'] > 90:

   print('The city is melting!')

 else:

   print('The temperature in New York is', temperatures['New York'])

else:

   print('The temperature in New York is unknown.')

The output is:

The city is melting!

The program basically has nested if statements. The first If statement checks if New York is present in temperatures list. If this is true then the program control enters another if condition which checks if the temperature value of New York is greater than 90. If this evaluates to true then message The city is melting! is displayed. If this evaluates to false then else part is executed which displays the temperature in New York. If none of the above if statements evaluate to true then the final else part is executed which displays The temperature in New York is unknown. Since the value of New York temperature is set to 105 so The city is melting! is displayed in output.

Indentation in python is important as it does not uses indentation instead of using brackets to describe a block of statement. It makes the code readable. See the above nested if statements. The inner If statement is indented in such a way that it looks inside the outer if statement without the use of brackets. The else part of inner if is placed right below inner if and the else part of the outer if indented below the outer if statement. Also the print statement are indented with their corresponding if and else parts.

You might be interested in
How much horse power do you think a Dodge Challenger hellcat has?
ArbitrLikvidat [17]

Answer:

Its prob around 700

Explanation:

4 0
3 years ago
Read 2 more answers
How did technology change society in the Renaissance?
WINSTONCH [101]
I think it’s A


Hope I helped
8 0
3 years ago
Read 2 more answers
An air conditioner operating at steady state maintains a dwelling at 70°F on a day when the outside temperature is 99°F. The rat
IrinaVladis [17]

Answer:

a) the coefficient of performance of the air conditioner is 3.5729

b)

- the power input required for a reversible air conditioner is 0.645 hp

- the coefficient of performance for the reversible air conditioner is 18.2759

Explanation:

Given the data in the question;

Lower Temperature T_L = 70°F = ( 70 + 460 )R = 530 R

Higher Temperature T_H = 99° F = ( 99 + 460 )R = 559 R

Cooling Load Q_L = 30000 Btu/h

we know that 1 hp = 2544.43 Btu/h

Net power input P = 3.3 hp = ( 3.3 × 2544.43 )Btu/h = 8396.619 Btu/h

a)

Coefficient of performance of the air conditioner;

COP_{air-condition = Cooling Load Q_L  / power P

we substitute

COP_{air-condition = 30000 Btu/h / 8396.619 Btu/h

COP_{air-condition = 3.5729

Therefore, the coefficient of performance of the air conditioner is 3.5729

b)

- Power input required ( in hp )

Q_L / P_{required = T_L / ( T_H - T_L )

we substitute

30000 Btu/h / P_{required = 530 R / ( 559 R - 530 R )

30000 Btu/h / P_{required = 530 R / 29 R

we solve for P_{required

P_{required  = ( 30000 Btu/h × 29 R ) / 530 R

P_{required  = ( 870000 Btu/h / 530 )

P_{required  = 1641.5094 Btu/h

we know that; 1 hp = 2544.43 Btu/h

so;

P_{required  = ( 1641.5094 / 2544.43 ) hp

P_{required  = 0.645 hp

Hence, the power input required for a reversible air conditioner is 0.645 hp

- the coefficient of performance for the reversible air conditioner;

COP_{rev-air-condition = T_L / ( T_H - T_L )

we substitute

COP_{rev-air-condition = 530 R / ( 559 R - 530 R )

COP_{rev-air-condition = 530 R / 29 R

COP_{rev-air-condition = 18.2759

Hence, the coefficient of performance for the reversible air conditioner is 18.2759

3 0
3 years ago
Airbags will deploy in a head on collision but not in a collision that occurs from angle
Aneli [31]

Answer:  

Airbags will deploy in almost any angle.

Explanation:

Cars have sensors around them, so when the car gets hit, the sensors detect a crash and deploy the airbags to keep you safe.

8 0
3 years ago
A market structure in which ther a single buyer
faltersainse [42]

Answer:

Monopsony

Explanation:

Kinda like a monopoly, except instead of one producer it is one buyer.

8 0
2 years ago
Other questions:
  • A buret is a device designed to precisely dispense liquids. The scale is calibrated in mL with the zero point at the top with nu
    6·1 answer
  • The water jacket is something you put on your engine when it rains?*<br> True<br> Or<br> False?
    5·2 answers
  • Create a program that calculates the monthly payments on a loan using Decimal &amp; LC Console SEE Sanple Run Attached Specifica
    14·1 answer
  • What are the de Broglie frequencies and wavelengths of (a) an electron accelerated to 50 eV (b) a proton accelerated to 100 eV
    10·1 answer
  • How to draw a location/site plan​
    11·2 answers
  • If the middle bend of a three-bend saddle is a 30-degree bend
    6·2 answers
  • What is protection scheme?
    12·1 answer
  • A 100-ampere resistor bank is connected to a controller with conductor insulation rated 75°C. The resistors are not used in conj
    8·1 answer
  • What is a chipping hammer used for? <br><br> State three things.
    7·2 answers
  • I want to hear 1 of your guy's best jokes
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!