Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Coding Problem #3 (6 points) 1 #Write a function called last_week_avgs. last_week_avgs should 2 #take a list of 2-tuples as input. There are guaranteed to
Coding Problem #3 (6 points) 1 #Write a function called last_week_avgs. last_week_avgs should 2 #take a list of 2-tuples as input. There are guaranteed to be 3 #at least seven 2-tuples in the list. Each 2-tuple will have 4 #two integers. The first integer represents a low temperature 5 #on a particular day, the second represents the high 6 #temperature on that day. 7 # 8#last_week_avgs should return a 2-tuple with two integers. 9 #The first integer should be the average of the last seven 10 #days low temperatures. The second integer should be the 11 #average of the last seven days high temperatures. Both 12 #should be rounded to the nearest whole integer (you can 13 #use int (round(the_temp, 0)) to round the temperature to 14 #the nearest integer, then convert it to an integer). 15 # 16 #For example, imagine the function was called with the 17 #following list of tuples: 18 # 19 #(57, 67), (59, 65), (52, 59), (51, 65), (55, 71), (58, 73), 21 # 22 #last week_avgs would return (54, 66). The first numbers of 23 #
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started