CS110: Winter 2021

Intro to Computer Programming with Python

CS110: Winter 2021

Lessons > 8. Modules and Variable Scope

In today’s pre-recorded lectures, we are going to go over:

  1. Modules: a way of organizing and reusing code, and
  2. Variable scope: what parts of memory can your program access at any given time?

In live lecture, we will pick up from Wednesday and try our diamond exercise again (without rushing through it).

Today's Activities

1. Download the Exercise Files

Exercise Files

2. Review the Slides

  1. 8a. Modules
  2. 8b. Variable Scope
  3. Supplementary Slides for Live Lecture

3. Review the Lecture Video(s)

Link Type Title Duration
Video 1 required Modules 20:05
Video 2 required Variable Scope 16:43
Video 3 lecture Live Lecture 53:41

4. Review the References & Supplemental Materials

Note: these readings / videos are suggested for additional context / examples, but not required.

  1. Heinold Ch12: Modules.
    Skim sections 12.1 through 12.4.

5. Do the Practice Quiz (Exercises)

Note: The quiz is to help you test your own understanding of the concepts. It is not graded, and is designed to help you to see what you already know and what you should review / ask about.
https://canvas.northwestern.edu/courses/130514/quizzes/132652/