strange behavor....

Tracubik affdfsdfdsfsd at b.com
Sat Nov 13 08:46:29 EST 2010


hi all,
i've this on python 2.6.6:

>>> def change_integer(int_value):
...     int_value = 10
...     
... def change_list(list):
...     list[0] = 10
...     
... a = 1
... l = [1,1,1]
... 
... change_integer(a)
... change_list(l)
... 
... print a
... print l
1
[10, 1, 1]

why the integer value doesn't change while the list value do?
in Pascal i can choose the behavour of parametres, how this work on Python?
also a link could be appreciated

Thanks in advance
Nico



More information about the Python-list mailing list