Q: function parameters again

Hwanjo Yu hwanjoyu at uiuc.edu
Mon Jan 29 18:53:34 EST 2001


Hi,
The book says the parameters are passed by reference, but the following
example seems not.
How can I pass it by reference in the following example ?

>>> def func(a):
...   a = a + 1
...
>>> a = 3
>>> func(a)
>>> print a
3

Thank you.





More information about the Python-list mailing list