2025-plovdiv-ODD/exercises/Exercise 1b Unprotected code.md
2025-07-20 22:10:03 +02:00

694 B

Exercise 1b: Unprotected code

Goal

Investigate what happens when importing from modules with "unprotected" code.

Preparation

(none)

Tasks

  1. Create a file in the src/ folder called unprotectd_code.py.

  2. Add a line in unprotectd_code.py that imports the todays_special function from daily_menu.py.

  3. BEFORE YOU EXECUTE THE FILE. Discuss with your partner what you think will happen when you run unprotectd_code.py.

  4. Run unprotectd_code.py. Does your prediction match reality?

  5. (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?