662 B
662 B
Exercise 2a: Unprotected code
Goal
Investigate what happens when importing from modules with "unprotected" code.
Preparation
(none)
Tasks
-
Create a file in the
src/
folder calledmain.py
. -
Add a line in
main.py
that imports themake_example_potion
function frommake_potion.py
. -
BEFORE YOU EXECUTE THE FILE. Discuss with your partner what you think will happen when you run
main.py
. -
Run
main.py
. Does your prediction match reality? -
(optional, for those who know) Discuss with your partner:
- Why did this behaviour occur?
- Why is it not good?
- What can you do to "fix" the behaviour?