locals() Is Read-Only : Local Variables : Language Basics PYTHON examples


PYTHON examples » Language Basics » Local Variables »

 

locals() Is Read-Only


locals() Is Read-Only: globals() Is Not

def foo(arg)
    x = 
    print locals()             
    locals()["x"2          
    print "x=",x               

z = 
print "z=",z 
foo(3
globals()["z"8             
print "z=",z                   
           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


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


PYTHON examples

 Navioo Language Basics
» Local Variables


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0