| Thread Previous • Date Previous • Date Next • Thread Next |
Question #235985 on Yade changed:
https://answers.launchpad.net/yade/+question/235985
Bruno Chareyre proposed the following answer:
"global" is the keyword.
Bruno
a=0
def f():
a=1
print a
f()
>> 1
print a
>> 0
a=0
def f():
global a
a=1
print a
f()
>> 1
print a
>> 1
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.
| Thread Previous • Date Previous • Date Next • Thread Next |