Note: On the this lab you will again be able to work in pairs.
After reading through the lab assignment, create starter files for both lab7_weather.py
and lab7_aggregator.py
with “stubs” (i.e., function headers and the pass
statement) for any required function. In particular, lab7_weather.py
needs to have a stub for the function get_temperature
(which takes a string parameter representing a zipcode). And both files should have a docstring at the top with a one-line description of the program, then a blank line, then subsequent lines with information such as your name, section, and assignment name (similar to previous assignments).
Submit your programs via Gradescope as you would for the lab assignment itself. Your files must be named lab7_weather.py
and lab7_aggregator.py
, and you must submit both files at the same time. You can submit multiple times, with only the most recent submission (before the due date) graded.
To further prepare for the assignment:
Try out the following functions so you understand what they do and how they work. Once you have figured out how these functions work, write appropriate docstrings. I encourage you to include these functions (and your newly written docstrings) in your lab7_aggregator.py
file (although you not required to do so).
import datetime
def get_hour():
now = datetime.datetime.now()
return str(now.hour)
def get_date():
now = datetime.datetime.now()
return str(now.month) + "-" + str(now.day) + "-" + str(now.year)
python3
(or python
on Windows) from the command line as demonstrated in class. That is open the system shell from the Thonny menu “Tools->Open System Shell…”lab7_weather.py
and lab7_aggregator.py
. I encourage you to write out preliminary designs for your programs on paper in pseudocode.