City Теmp Avg Muscat 36.00 Sur 44.00 Salalah 21.67 Sohar 39.33 The average temperature is 35.25 The highest temperature is 44.00 recorded in Sur Cities with temperature above the average: City Тепр...


City<br>Теmp Avg<br>Muscat<br>36.00<br>Sur<br>44.00<br>Salalah<br>21.67<br>Sohar<br>39.33<br>The average temperature is 35.25<br>The highest temperature is 44.00 recorded in Sur<br>Cities with temperature above the average:<br>City<br>Тепр Avg<br>Muscat<br>36.00<br>Su<br>44.00<br>Sohar<br>39.33<br>Sample run<br>Your program must define and use the following functions only:<br>1. read(): reads the city names and temperatures from the input screen and stores<br>the names and temperature averages into two lists cities 'and tempAvg.<br>2. findaverage():returns the average temperature of the list passed as an<br>argument.<br>3. findMaxTempPos ():returns the position of the highest temperatures in the list.<br>4. displayResults():displays the output shown in the above sample run.<br>Note:<br>• All the displays should be done in displayResults() function.<br>

Extracted text: City Теmp Avg Muscat 36.00 Sur 44.00 Salalah 21.67 Sohar 39.33 The average temperature is 35.25 The highest temperature is 44.00 recorded in Sur Cities with temperature above the average: City Тепр Avg Muscat 36.00 Su 44.00 Sohar 39.33 Sample run Your program must define and use the following functions only: 1. read(): reads the city names and temperatures from the input screen and stores the names and temperature averages into two lists cities 'and tempAvg. 2. findaverage():returns the average temperature of the list passed as an argument. 3. findMaxTempPos ():returns the position of the highest temperatures in the list. 4. displayResults():displays the output shown in the above sample run. Note: • All the displays should be done in displayResults() function.
Exercise 1: Write a Python program that reads from the input screen n city names and<br>temperatures for the last 3 months for each city. And displays the following information:<br>The city names and their 3-month average temperature<br>The average temperature of all the cities<br>The highest temperature and its city name<br>The city names and temperatures for the cities with temperature above the average<br>temperature<br>Muscat<br>Nizwa<br>35<br>4b<br>33<br>42<br>40<br>41<br>Error: Wrong input in Nizwa<br>47<br>20<br>41<br>45<br>Sur<br>Salalah<br>Sohar 38<br>28<br>39<br>40<br>17<br>City<br>Теmp Avg<br>========<br>36.00<br>44.00<br>Muscat<br>Sur<br>Salalah<br>21.67<br>Sohar<br>39.33<br>The average temperature is 35. 25<br>The highest temperature is 44.00 recorded in Sur<br>Cities with temperature above the average:<br>City<br>Теmp Avg<br>===== --<br>====<br>Muscat<br>36.00<br>Sur<br>44.00<br>

Extracted text: Exercise 1: Write a Python program that reads from the input screen n city names and temperatures for the last 3 months for each city. And displays the following information: The city names and their 3-month average temperature The average temperature of all the cities The highest temperature and its city name The city names and temperatures for the cities with temperature above the average temperature Muscat Nizwa 35 4b 33 42 40 41 Error: Wrong input in Nizwa 47 20 41 45 Sur Salalah Sohar 38 28 39 40 17 City Теmp Avg ======== 36.00 44.00 Muscat Sur Salalah 21.67 Sohar 39.33 The average temperature is 35. 25 The highest temperature is 44.00 recorded in Sur Cities with temperature above the average: City Теmp Avg ===== -- ==== Muscat 36.00 Sur 44.00
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here