Within a function, you can't use both local and global versions of the same name : Global : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Global »

 

Within a function, you can't use both local and global versions of the same name


X = 99 
def selector(  )
    import __main__           
    print __main__.X          
    X = 88                    
    print X                   

selector(  )



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Function
» Global