All pastes #24360 Raw Edit

Mine

public python v1 · immutable
#24360 ·published 2005-10-01 13:05 UTC
rendered paste body
>>> def foo2(x):...     x = 5...     return x...>>> as = 10>>> foo2(as)5>>> print as10>>> asd = [1,2]>>> foo2(asd)5>>> print asd[1, 2]So this means that arguments are passed by value, but lists (and other data structure) hold references to the data itself, so you are able to change values (and modify the argument variable) only if they are hold by data structures.