Python Namespace and Scope
1) Local Scope
2) Global Scope
3) Access Global Inside Function
4) Local vs Global with Same Name
5) Modify Global Inside Function
6) Nested Function & Enclosing Scope
7) Enclosing Scope Modification
8) Function Parameters & Local Scope
9) UnboundLocalError
10) Builtin Namespace
11) Shadowing Builtins
12) Scope Test with Loop
13) Scope in List Comprehension
14) Multiple Global Variables
15) Read-Only Global
16) Local Variable Persistence
17) Function Default Parameter Scope
18) Return vs Print
19) Variable Created Inside If Block
20) Nested Globals & Locals
π Notes & Concepts Practiced
Concept
What You Learn
π Mini Code Hints
Global vs Local
Modify Global
Nonlocal Example
Last updated