Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
# Historical Weather for February 2018 in Saskatoon # Daily Data is in the Format [date, day, high, low] weather_yxe_2018 = [ [2018-02-01,Thursday,-18.6,-30.6,], [2018-02-02,Friday,-19.6,-23.4,], [2018-02-03,Saturday,-22.3,-30.4,],
# Historical Weather for February 2018 in Saskatoon # Daily Data is in the Format [date, day, high, low] weather_yxe_2018 = [ ["2018-02-01","Thursday",-18.6,-30.6,], ["2018-02-02","Friday",-19.6,-23.4,], ["2018-02-03","Saturday",-22.3,-30.4,], ["2018-02-04","Sunday",-17.4,-27.7,], ["2018-02-05","Monday",-16.2,-25.3,], ["2018-02-06","Tuesday",-16.6,-27.8,], ["2018-02-07","Wednesday",-18.2,-30.5,], ["2018-02-08","Thursday",-18.1,-29.5,], ["2018-02-09","Friday",-15.5,-29.8,], ["2018-02-10","Saturday",-9.4,-19.6,], ["2018-02-11","Sunday",-19.2,-31.2,], ["2018-02-12","Monday",-14.5,-32.4,], ["2018-02-13","Tuesday",2.3,-17.4,], ["2018-02-14","Wednesday",0.1,-19.9,], ["2018-02-15","Thursday",-14.3,-32,], ["2018-02-16","Friday",-7.5,-21.2,], ["2018-02-17","Saturday",-11,-19.6,], ["2018-02-18","Sunday",-14.2,-25.9,], ["2018-02-19","Monday",-15.3,-30.2,], ["2018-02-20","Tuesday",-13.7,-28.6,], ["2018-02-21","Wednesday",-12.3,-31.3,], ["2018-02-22","Thursday",-8.1,-25.3,], ["2018-02-23","Friday",-6.2,-21.5,], ["2018-02-24","Saturday",-2,-14.1,], ["2018-02-25","Sunday",-3.7,-15.4,], ["2018-02-26","Monday",-5.2,-19.3,], ["2018-02-27","Tuesday",-4.4,-13.9,], ["2018-02-28","Wednesday",-0.3,-16.6,] ] # Write your list comprehensions below! # Part A) - Are any days above 0? # Part B) - Monday low temperatures? # Part C) - Temperature differences? # Part D) - Weekend Highs? Degree of Difficulty: Mostly Easy Some people hate February because it's so cold! In order to prepare ourselves for the month, let's look back at some historical weather data from 2018. Maybe it wasn't as bad as we remember? In a4q2 starter pyyou are given a definition of a list of lists. Each sublist contains four pieces of information -the date, day of the week, daily high temperature, daily low temperature Create the following list comprehensions (a) Are any days above 0? Use a single list comprehension to create a list of the dates where the daily (b) Mondays are the worst. Use a single list comprehension to create a list of the daily low temparatures (c) Some days start cold but get much warmer. Use a single list comprehension to create a list of the (d) But what about the weekend!? Use a single list comprehension to create a list of lists where each sub- high temperature was more than O and print) the results. for days that are Monday and print O the results. difference between the daily low and daily high temperature for each date and print the results. list consists of a date and daily high temperature, but only include dates that are Saturday or Sunday and print O the results. Note that this question is to test your use of st comprehensions. Nomarks will be given for solutions that do not use list comprehensions. Please be sure to use print to show your results in the console
# Historical Weather for February 2018 in Saskatoon
# Daily Data is in the Format [date, day, high, low]
weather_yxe_2018 = [
["2018-02-01","Thursday",-18.6,-30.6,],
["2018-02-02","Friday",-19.6,-23.4,],
["2018-02-03","Saturday",-22.3,-30.4,],
["2018-02-04","Sunday",-17.4,-27.7,],
["2018-02-05","Monday",-16.2,-25.3,],
["2018-02-06","Tuesday",-16.6,-27.8,],
["2018-02-07","Wednesday",-18.2,-30.5,],
["2018-02-08","Thursday",-18.1,-29.5,],
["2018-02-09","Friday",-15.5,-29.8,],
["2018-02-10","Saturday",-9.4,-19.6,],
["2018-02-11","Sunday",-19.2,-31.2,],
["2018-02-12","Monday",-14.5,-32.4,],
["2018-02-13","Tuesday",2.3,-17.4,],
["2018-02-14","Wednesday",0.1,-19.9,],
["2018-02-15","Thursday",-14.3,-32,],
["2018-02-16","Friday",-7.5,-21.2,],
["2018-02-17","Saturday",-11,-19.6,],
["2018-02-18","Sunday",-14.2,-25.9,],
["2018-02-19","Monday",-15.3,-30.2,],
["2018-02-20","Tuesday",-13.7,-28.6,],
["2018-02-21","Wednesday",-12.3,-31.3,],
["2018-02-22","Thursday",-8.1,-25.3,],
["2018-02-23","Friday",-6.2,-21.5,],
["2018-02-24","Saturday",-2,-14.1,],
["2018-02-25","Sunday",-3.7,-15.4,],
["2018-02-26","Monday",-5.2,-19.3,],
["2018-02-27","Tuesday",-4.4,-13.9,],
["2018-02-28","Wednesday",-0.3,-16.6,]
]
# Write your list comprehensions below!
# Part A) - Are any days above 0?
# Part B) - Monday low temperatures?
# Part C) - Temperature differences?
# Part D) - Weekend Highs?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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