modifing function's parameters global value

Federico maschio_77 at hotmail.com
Tue May 13 14:16:11 EDT 2003


Here is an example:

x=1
def func(y):
    y=y+1
    print y
print x
func(x)
print x

I have
1
2
1
but I'd like to have
1
2
2
there is no way to modify a parameter in a function? In C I used pointers...

Thanks






More information about the Python-list mailing list