answer.
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
Bumek
3 months 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:
Daniel [329]3 months ago
4 0

Answer: Below is the correctly formatted 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:

This is the entire 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 will be:

The city is melting!

This program mainly comprises nested if statements. The first check determines if 'New York' exists within the temperature data. When confirmed, it moves to another if statement to see if New York's temperature exceeds 90. If true, it outputs the message, "The city is melting!". If false, it presents the actual temperature of New York. If neither condition is satisfied, it defaults to showing that the temperature is unknown. Given that New York's temperature is 105, the output reflects that the city is melting!

Proper indentation is crucial in Python, as it distinguishes code blocks without needing brackets, enhancing readability. Observe how the nested if statements are structured within the outer if statement. The else statements align appropriately beneath their respective if declarations, and print statements follow the necessary indentation.

You might be interested in
A thin-film gold conductor for an integrated circuit in a satellite application is deposited from a vapor, and the deposited gol
mote1985 [299]

Answer:

Explanation:

The equilibrium vacancy concentration can be described by:

nv/N = exp(-ΔHv/KT),

where T is the temperature at which vacancies form,

K = Boltzmann's constant,

and ΔHv = enthalpy of vacancy formation.

Rearranging this equation to express temperature allows you to calculate it using the provided values. A detailed breakdown of the process is included in the attached file.

5 0
2 months ago
A subway car leaves station A; it gains speed at the rate of 4 ft/s^2 for of until it has reached and then at the rate 6 then th
Daniel [329]

Answer:

Refer to the attached document

1512 ft

Explanation:

Because the acceleration is constant or zero, the acceleration-time graph consists of horizontal segments. The values for t2 and a4 are derived as follows:

Acceleration - Time

0 < t < 6: Velocity change = area beneath the a–t graph

V_6 - 0 =  (6 s)(4 ft/s²) = 24 ft/s

6 < t < t2: The velocity rises from 24 to 48 ft/s,

Velocity change = area beneath the a–t graph

48 - 24 = (t2 - 6) * 6

t2 = 10 s

t2 < t < 34: The velocity remains constant, meaning acceleration is zero.

34 < t < 40: Velocity change = area beneath the a–t graph

0 - 42 = 6*a4

a4 = - 8 ft / s²

A negative acceleration shows the area lies below the t-axis, indicating a decrease in speed.

Velocity - Time

Since acceleration remains constant or zero, the v−t graph is made up of linear segments connecting the calculated points.

Position change = area beneath the v−t graph

0 < t < 6:  x6 - 0 = 0.5*6*24 = 72 ft

6 < t < 10:    x10 - x6 = 0.5*4*(24 + 48) = 144 ft

10 < t < 34: x34 - x10 = 48*24 = 1152 ft

34 < t < 40: x40 - x34 = 0.5*6*48 = 144 ft

Summing these position changes yields the distance from A to B:

d = x40 - 0 = 1512 ft

8 0
2 months ago
Three return steam lines in a chemical processing plant enter a collection tank operating at steady state at 1 bar. Steam enters
alex41 [359]

Response:

a) 4 kg/s

b) 99.61 °C

Rationale:

Refer to the pictures provided.

5 0
1 month ago
Six years ago, an 80-kW diesel electric set cost $160,000. The cost index for this class of equipment six years ago was 187 and
grin007 [323]

Answer:

total expense for the new boiler = $229706.825

total expense for new boiler = $127512

Explanation:

provided information

initial power p1 = 80 kW

price C = $160000

cost index CI 1 = 187

cost index CI 2= 194

capacity factor f = 0.6

subsequent power p2 = 120 kW

present cost = $18000

to determine

total expense and cost for 40 kW

solution

we evaluate CN cost for the new boiler and CO cost for the existing boiler

where x represents the capacity of the new boiler

first we compute the current cost of the old boiler which is

current cost CO = C × \frac{CI 1 }{CI 2 }.............1

substituting the value here

current cost = 160000 × \frac{194 }{187 }

updated current cost = $165989.304

and

employing power sizing strategy for 124 kW

CN/CO = (\frac{p2}{p1} )^{f}...............2

insert value and calculate CN

CN/CO = (\frac{p2}{p1} )^{f}  

CN / 165989.304 = (\frac{120}{80} )^{0.6}  

CN = 211706.825

therefore the new expense = $211706.825

hence

total expense for the new boiler amounts to

total expense = new expense + current cost

total exp = 211706.825 + 18000

boiler expense total = $229706.825

and

concerning a 40 kW unit, the calculated new cost will be

applying equation 2

CN/CO = (\frac{p2}{p1} )^{f}

CN / 165989.304 = (\frac{40}{80} )^{0.6}  

CN = 109512

thus the new cost is $109512

therefore

total expense for the new boiler is

total exp = new cost + current cost

total expense = 109512 + 18000

total cost for the new boiler = $127512

7 0
2 months ago
An art collector is bidding on a statue that would complete a collection he is trying to assemble. The statue is being sold in a
Kisachek [356]

Answer: Equal to the collector’s maximum willingness to pay for the statue.

Explanation:

The Vickrey auction, often referred to as a sealed second-price auction, is a bidding format named after the Canadian economist Vickrey. In this auction style, participants submit bids in a concealed manner, preventing others from viewing the amounts being offered.

The collector should bid an amount he or she is comfortable paying for the statue, to ensure they do not feel disadvantaged by the bidding process. In this auction system, the final price paid corresponds to the second-highest bid rather than the highest bid submitted.

8 0
2 months ago
Other questions:
  • A. Calculate the fraction of atom sites that are vacant for lead at its melting temperature of 327°C (600 K). Assume an energy f
    5·1 answer
  • Who play 1v1 lol unblocked games 76
    8·2 answers
  • Degreasers can be broken down into two main categories
    9·2 answers
  • Multiply each element in origList with the corresponding value in offsetAmount. Print each product followed by a space.Ex: If or
    13·1 answer
  • A pitfall cited in Section 1.10 is expecting to improve the overall performance of a computer by improving only one aspect of th
    6·1 answer
  • An air duct heater consists of an aligned array of electrical heating elements in which the longitudinal and transverse pitches
    5·1 answer
  • At a certain elevation, the pilot of a balloon has a mass of 120 lb and a weight of 119 lbf. What is the local acceleration of g
    6·1 answer
  • 1. A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions
    7·1 answer
  • A cylinder with a 6.0 in. diameter and 12.0 in. length is put under a compres-sive load of 150 kips. The modulus of elasticity f
    5·1 answer
  • A solid steel shaft has to transmit 100 kW at 160 RPM. Taking allowable shear stress at 70 Mpa, find the suitable diameter of th
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!