0) into two lists: a list to hold the names of the cities and another one to store thetemperatures of each city. Then using these two lists, your program should find and displaythe following...


Write a Python program that reads from user the names and temperatures of n cities (n must<br>be > 0) into two lists: a list to hold the names of the cities and another one to store the<br>temperatures of each city. Then using these two lists, your program should find and display<br>the following information as shown in sample output below:<br>The average temperature of all cities<br>The names and temperatures of cities with their temperature above the average<br>The names and temperatures of cities with their temperature below the average.<br>Enter number of cities (n) : 6<br>The average temperature is 34.167<br>Enter name and temperature of city 1: Muscat 32<br>Cities with temperature above average are:<br>Nizwa<br>Sur<br>Sohar<br>Musandam<br>Enter name and temperature of city 2: Nizwa 35<br>35.0<br>40.0<br>Enter name and temperature of city 3: Sur 40<br>42.0<br>38.0<br>Enter name and temperature of city 4: Salalah 18<br>Cities with temperature above average are:<br>Enter name and temperature of city 5: Sohar 42<br>Muscat<br>Salalah<br>32.0<br>18.0<br>Enter name and temperature of city 6: Musandam<br>Sample output (exercise 1)<br>Sample input (exercise 1)<br>Write a Python program that initializes a list with ten random integers values within the range<br>[1,100]. Find and display the following as shown in the sample output below:<br>The generated numbers<br>Maximum number in the list<br>Minimum number in the list<br>List of numbers:<br>Maximum value:<br>10<br>62 16 46 10 74 12 39 88 32 90<br>90<br>Average of numbers in the list<br>Minimum value:<br>46<br>Average value:<br>Sample output (exercise 2)<br>

Extracted text: Write a Python program that reads from user the names and temperatures of n cities (n must be > 0) into two lists: a list to hold the names of the cities and another one to store the temperatures of each city. Then using these two lists, your program should find and display the following information as shown in sample output below: The average temperature of all cities The names and temperatures of cities with their temperature above the average The names and temperatures of cities with their temperature below the average. Enter number of cities (n) : 6 The average temperature is 34.167 Enter name and temperature of city 1: Muscat 32 Cities with temperature above average are: Nizwa Sur Sohar Musandam Enter name and temperature of city 2: Nizwa 35 35.0 40.0 Enter name and temperature of city 3: Sur 40 42.0 38.0 Enter name and temperature of city 4: Salalah 18 Cities with temperature above average are: Enter name and temperature of city 5: Sohar 42 Muscat Salalah 32.0 18.0 Enter name and temperature of city 6: Musandam Sample output (exercise 1) Sample input (exercise 1) Write a Python program that initializes a list with ten random integers values within the range [1,100]. Find and display the following as shown in the sample output below: The generated numbers Maximum number in the list Minimum number in the list List of numbers: Maximum value: 10 62 16 46 10 74 12 39 88 32 90 90 Average of numbers in the list Minimum value: 46 Average value: Sample output (exercise 2)
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here