global variable not assigned, newbie question

Jean-Daniel Gamache jdgamache at hotmail.com
Mon Nov 1 09:51:54 EST 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