1 KiB
1 KiB
Exercise 2a: Local importing
Goal
Retrival practice in "basic" importing.
Preparation
(none)
Tasks
- Create a file in the
src/
folder calledmake_potion.py
and copy the code below into it.
# ADD IMPORT STATEMENTS HERE!
def make_example_potion(student_name="ASPP student"):
my_potion = potion_class.Potion(student_name=student_name)
# Set up your old kettle and light an eternal flame underneath it.
my_potion.setup(container=containers.old_kettle, heat_source="eternal_flame")
# Simmer for 5 hours.
cooking.simmer(my_potion, duration=5)
print(f"You successfully ran make_example_potion, {student_name}, well done :).")
return my_potion
my_name = 'ASPP student'
my_potion = make_example_potion(student_name=my_name)
-
Figure out what import statements are missing, either by visual inspection or by running the code and seeing what dies. Add the missing import statements at the top of the file. You may need to inspect the files in
src/brewing/
. -
Run
make_potion.py
. Did it work?