CH. 3 Working With Functions NOTES
CH. 3 Working With Functions NOTES
● Global Scope
● Local Scope
Local Scope
With local scope, variable can be used only within the function / block that
it is created. Local variable is defined inside an function.
Eg:
def test ( ):
y = 20 # local variable
print("inside test( ) value of x is ", x, " y is " , y)
eg:
def test ( ):
print("inside test x is ", x)