Shadow variable : Variable Scope : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Variable Scope »

 

Shadow variable


def foo():
    print "ncalling foo()..."
    bar = 200
    print "in foo(), bar is", bar

bar = 100
print "in __main__, bar is", bar
foo()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Function
» Variable Scope