Question: Purpose: To practice your ability to modify lists and compute values with listsFor this question, we have a full years worth of temperature data for
Purpose: To practice your ability to modify lists and compute values with listsFor this question, we have a full years worth of temperature data for the city of Saskatoon. But theres aproblem: the temperatures are all in degrees Fahrenheit! In order to make this data meaningful to Canadians, we need to convert the data to degrees Celsius and then compute the average temperature for eachmonth.Starter FileYou have been provided a starter file that contains the daily high temperatures for Saskatoon from the year The data is in a list of lists. Each sublist represents all the data for one month, with the first sublistbeing the data from January, the second being the data from February, and so on The values in eachsublist are temperatures measured in degrees Fahrenheit.From here, you will write three separate functions to perform three tasks, as described below.Converting unitsWrite a function that accepts a single temperature value in degrees Fahrenheit, and returns the matchingvalue in degrees Celsius. This function should be very simple; its just a helper function that you will uselater.Converting all the dataWrite a function that accepts the listoflists of temperature data. For each temperature value in eachsublist, the function should REPLACE that value with its matching value in degrees Celsius. Use yourhelper function to perform each calculation.This function does not create any new lists and does not have a return value. None is needed. It simplymodifies the existing lists of temperature values.Calculating Monthly AveragesWrite a function that accepts the listoflists of temperature data, and that returns a list containing theaverage temperature for each month in the data.Recall that each sublist contains all the data for a single month, and since there are such sublists, thelist you return should have exactly numbers in itProgram OutputAt the very bottom of your program, call the functions you made above, using their return values appropriately. Then use the list returned by the last function to print out the average temperature for each monthin a readable format.Page
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
