Weekly Weather in Massawa
Python
30 pts
Weekly Weather in Massawa
The tuple temperatures holds the daily temperatures in Massawa for one week (day 1 to day 7). Create:
highestandlowest— the highest and lowest temperaturesaverage— the average, rounded to 1 decimal placehottest_day— the day number (1 to 7) of the highest temperaturesorted_temps— a tuple of the temperatures from lowest to highest
Then print them like this:
Highest: 38 Lowest: 29 Average: 33.1 Hottest day: 4 (29, 30, 31, 33, 35, 36, 38)
Checklist
- Keep
temperaturesunchanged and createhighestandlowest. - Create
average, rounded to 1 decimal place. - Create
hottest_day, the day number (1 to 7) of the highest temperature. - Create
sorted_temps, a tuple from lowest to highest. - Print the results as shown.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
