841 B
841 B
Exercise 1a: Local importing
Goal
Retrieval practice in "basic" importing.
Preparation
(none)
Tasks
We are simulating having code in one folder and calling the code from the folder above.
- Create a file in the
src/
folder calleddaily_menu.py
and copy the code below into it.
def todays_special():
pizza_margherita = make_margherita_pizza()
lemonade = make_lemonade()
print("Today's special is ready! Buon Appetito!\n")
return pizza_margherita, lemonade
pizza, drink = todays_special()
-
Figure out what import statements are missing, either by visual inspection or by running the code and seeing what it does. Add the missing import statements at the top of the file. You may need to inspect the files in
src/italianfood/
. -
Run
daily_menu.py
. Did it work?