Oct 30: Immutability, Aliasing
Meet in EnGeo 2208
Learning Objectives
After today's class, you should be able to:
- Explain why a string method returns a new string.
- Contrast strings with lists, which can be changed in place.
- Predict what happens to a list modified inside a function.
Lesson Outline
Presentation [10 min]
- Review of lists, dictionaries, and files
- Python Reference Sheet provided on Quiz 4
Mini Lecture [25 min]
- Python Tutor
- Passing strings and lists to functions
- Objects (boxes) + references (arrows)
Q4–Q6 [15 min]
- Building with a loop
- Counting with a dict
- Reasoning about pytest
Your To-Do List
- Required before Monday's class:
- PA3: Gift Swap OR PA3: Trivia Night
- Submit to Gradescope until you get 100%
- Don't use AI; visit TA Hours to get help
- Have a safe and Happy Halloween! 🎃 👻