x = 1def fun(a): b=3 x=4 def sub(c): d=b global x x = 7 print ("Nested Functionn") print locals() sub(5) print ("nFunctionn") print locals() print locals()["x"] print globals()["x"]print ("nGlobalsn")print globals()fun(2)
Name (required)
email (will not be published) (required)
Website