global variable not assigned, newbie question

Jean-Daniel Gamache jdgamache at hotmail.com
Mon Nov 1 15:51:54 CET 2004


Hi! here's a python newbie question ...
why is my variable (myNum) not assigned the value 10 ???

========

myNum = 0

def setNum():
    myNum = 10
    print myNum
    
def main():
    setNum()
    print myNum

if __name__ == '__main__':
    main()



More information about the Python-list mailing list