Python Scope and Big O (again)
Sources
VIDEOS
ARTICLES
Python Scope
NOTES
Python Scope
- Global scope is how you define things availiable to all your code
- local is only availiable to local code
- the “global” tag can be used inside a function to give a variable global scope
- by default, variables outside of functions have global scope
- “Enclosing (or nonlocal) scope is a special scope that only exists for nested functions. If the local scope is an inner or nested function, then the enclosing scope is the scope of the outer or enclosing function. This scope contains the names that you define in the enclosing function. The names in the enclosing scope are visible from the code of the inner and enclosing functions.”- from the article
- nonlocal/ enclosed scope is what happens when you nest functions in other functions
The Video was Privated???