Variables declared and defined in the Program , has scope associated with in. Namespace is a place variables have reference in it. Variables can be declared outside the function,variables as function parameters, variables declared with in the function,variables declared with in the nested functions, variables in the class attributes.
Variables has following scopeNote:
A class is never used as a global scopeVariables declared at Function level
This technique is used when nested functions looks for Variables
Variables declared at Module level
Python Framework Variables and methods in builtins module are available to run Python code without any external imports