+ 1
Python scope: a definition of scope and how it applies to python.
scope can be thought of as a work space and is a universal programming term. In python, scope is determined by indentation. there are two different types of scope, global and local. a local scope resides within a class or function definition while global lays outside. ex: def hi(): "" this line the definition is in the global scope"" print("hi")"""while this line is within the local scope of the function "hi()". "" a variable that does not reside in the scope you are calling it in will be an error.
1 Answer
+ 1
I will be adding more details soon about accessing variable that do not reside within the scope you are in