Modifying Global Variables from Within a Function
Josh Tomkins
josht at iname.com
Sun Jan 9 14:40:26 EST 2000
Hello Everyone!
This is, perhaps, a newbie type of question (I am new to Python), but
here goes:
Can you modify a global variable from inside a function? Basically what
I want to do is this:
a = 0 #global variable
def func1(None):
a = 5 #or whatever
return
def func2(None):
#do stuff here
func1(None)
#do more stuff with the newly modified a
return
this is a contrived example. In reality, I will need to modify several
variables, changing them to zero. Is this possible?
Thanks,
Josue
More information about the Python-list
mailing list