To fully understand how Python code executes, we need to visualize what happens in the global space, the call stack where call frames live, and the heap space where objects (folders) live.
Slides: individual slides for viewing, 6-up layout for printing
These slides have been updated after lecture to answer some students' questions during lecture. See slides 24 - 27. Slides 33 to 38 correspond to the pre-lecture videos and were not discussed during lecture.
To download the above .py files, right-click (Windows) or command-click (Macs) on the filename and then select "Save link as".
This way you choose where the files will be saved, instead of having your computer save to the default folder (from which you will later have to move your files for organization).
Answers to the questions on slides 27, 31, and 39: See the lecture slides file above for the questions. After solving the problems yourself, you can check your answers here. Here is a short video explaining the answer to Question 2 (slide 31). Reminder: Although you can use Python Tutor to visualize code execution, you must also learn to draw the diagrams yourself in order to demonstrate that you truly understand the concept.