Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Historical Weather for January 2023 in Saskatoon Daily Data is in the Format [date, day, high, Low] temperature in veather vxe 2023=1 [2023-01-01, Sunday, 8.1,24.61,

image text in transcribed
image text in transcribed
Historical Weather for January 2023 in Saskatoon Daily Data is in the Format [date, day, high, Low] temperature in veather vxe 2023=1 ["2023-01-01", "Sunday", 8.1,24.61, ["2023-81-02", "Monday", - 8, - 19], ["2023-01-03", "Tuesday", - 5.1,17.6], ["2023-01-04", "Wednesday", 9.9,20.1], ["2023-01-05", "Thursday", 13.6,22.1], ["2023-01-06", "Friday", - 12.3, - 17.1], ["2023-01-07", "Saturday", 10.2,17.9 ], ["2023-01-08", "Sunday", 8.5,17.9], ["2023-01-09", "Monday", - 11.8, - 20.4], ["2023-01-10", "Tuesday", 10,18.5], ["2023-01-11", "Wednesda", 8.4,12 ], ["2023-01-12", "Thursday", 9.8,16.7], ["2023-01-13", "Friday", - 12, - 18], ["2023-01-14", "Saturday", 8,14.6], ["2023-01-15", "Sunday", - 7.7, - 9.6], ["2023-01-16", "Monday", - 6.5, - 9], ["2023-01-17", "Tuesday", 9,11.3], ["2023-01-18", "Wednesday", 5.6,10.2], ["2023-01-19", "Thursday", 4.3, 9.3], ["2023-01-20", "Friday", 6.5,16.4], ["2023-01-21", "Saturda", 3.7,15.7], ["2023-01-22"," "Sunday", 1.3,-9.2], ["2023-01-23", "Monday", - 1.1, - 16.3], ["2023-01-24", "Tuesday", 6.2,12.2], ["2023-01-25", "Wednesday", 2.6,6.4], ["2023-01-26", "Thursday", 3.7,6.8], ["2023-01-27", "Friday", 4.2,23.4],, ["2023-01-28", "Saturday", - 18, - 26.7], ["2023-01-29", "Sunday", - 18.6, - 28.9], ["2023-01-30", "Monday", - 19, - 29.6], ["2023-01-31", "Tuesday", - 16.3, - 25.4] 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? Purpose: To practice creating and manipulating lists with list comprehensions. Degree of Dificulty: Mostly Easy Let's look at some weather data from January 2023, which properly represented a Saskatchewan winter. In a5q2v1_starter.py you are given a definition of a list of lists. Each sublist contains three pieces of information - the date, the day daily high temperature, daily low temperature. Create the following list comprehensions:. (a) Are there any days where the temperature was above 0 ? Use a single list comprehension to create a list of the dates where the daily high temperature was more than O and print() the results. (b) You probably would agree that Monday is the worst day to be cold. Use a single list comprehension to create a list of the daily low temperatures for Mondays and print () the results. (c) Some days start cold but get much warmer. Use a single list comprehension to create a list of the difference between the daily low and daily high temperature for each date and print ( ) the results. (d) But what about the weekends!? Use a single list comprehension to create a list of lists where each sublist consists of a date and daily high temperature, but only include dates that are Saturday or Sunday and print () the results. Note that this question is to test your use of list comprehensions. No marks will be given for solutions that do not use list comprehensions. Please be sure to use print () to show your results in the console. What to Hand In Rename your completed a5q2v1_starter.py file to a5q2v1.py and submit it. The version number (v1) portion of the file names must be changed to v2, v3 etc. each time you resubmit your assignment. Remember to include all your solution files each time you submit/resubmit your assignment. Evaluation - 1 mark each for parts (a), (b), and (c). - 2 marks for part (d)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions