adds 2025 materials
This commit is contained in:
commit
e85b3b21ca
23 changed files with 378 additions and 0 deletions
24
exercises/Exercise 1b Unprotected code.md
Normal file
24
exercises/Exercise 1b Unprotected code.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
## Exercise 1b: Unprotected code
|
||||
|
||||
#### Goal
|
||||
|
||||
Investigate what happens when importing from modules with "unprotected" code.
|
||||
|
||||
#### Preparation
|
||||
|
||||
(none)
|
||||
|
||||
#### Tasks
|
||||
|
||||
0. Create a file in the `src/` folder called `unprotectd_code.py`.
|
||||
|
||||
1. Add a line in `unprotectd_code.py` that imports the `todays_special` function from `daily_menu.py`.
|
||||
|
||||
2. **BEFORE YOU EXECUTE THE FILE**. Discuss with your partner what you think will happen when you run `unprotectd_code.py`.
|
||||
|
||||
3. Run `unprotectd_code.py`. Does your prediction match reality?
|
||||
|
||||
4. (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?
|
Loading…
Add table
Add a link
Reference in a new issue