objectives: Creating and manipulating lists Accessing lists elements Traversing lists Using basic functions and lists methods Designing and implementing solutions requiring simple lists and parallel...


objectives:


Creating and manipulating lists



  • Accessing lists elements

  • Traversing lists

  • Using basic functions and lists methods

  • Designing and implementing solutions requiring simple lists and parallel lists



Exercises:


Write a Python program that defines two lists: list city that stores the names of 6 cities in Oman, and list temp that stores the temperatures of these cities. Use initialization lists to construct the city and temp lists with same sample data.


Using these two lists, your program should print the average temperature in Oman, and tables of hot temperature cities, cold temperature cities and mild temperature cities. Based on the following criteria: Hot temperatures fall in the range >=40


Mild temperatures fall in the range (20,40)


Cold temperatures fall in the range <=20 a="" sample="" run="" is="" given="">


The average temperature in Oman is 34.17 Celsius.<br>Hot Temperatures cities:<br>City<br>Temperature<br>Sur<br>40<br>Sohar<br>42<br>Cold Temperaturescities:<br>City<br>Temperature<br>Salalah<br>18<br>Mild Temperatures cities:<br>City<br>Temperature<br>Muscat<br>Nizwa<br>Musandam<br>32<br>35<br>38<br>

Extracted text: The average temperature in Oman is 34.17 Celsius. Hot Temperatures cities: City Temperature Sur 40 Sohar 42 Cold Temperaturescities: City Temperature Salalah 18 Mild Temperatures cities: City Temperature Muscat Nizwa Musandam 32 35 38

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here