Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Python Let's look at some weather data from January 2023 , which properly represented a Saskatchewan winter. In a5q2v1_starter. py you are given a

Use Pythonimage text in transcribedimage text in transcribed

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. 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

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago