Please enable JavaScript to use CodeHS

AP Computer Science Principles in Python

Lesson 5.6 Local Variables and Scope

Description

In this lesson we explore the scoping of a variable, which is where the variable is “defined” or where it exists.


Objective

Students will be able to:

  • Identify the scope of a variable
  • Identify which variables are in scope at a given point in a program