no pass-values calling?

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Jan 16 06:51:22 EST 2008


J. Peng a écrit :
> On Jan 16, 2008 2:30 PM, Steven D'Aprano
> <steven at remove.this.cybersource.com.au> wrote:
>> On Wed, 16 Jan 2008 13:59:03 +0800, J. Peng wrote:
>>
>>> Hi,
>>>
>>> How to modify the array passed to the function? I tried something like
>>> this:
>>>
>>>>>> a
>>> [1, 2, 3]
>>>>>> def mytest(x):
>>> ...   x=[4,5,6]
>>
>> This line does NOT modify the list [1, 2, 3]. What it does is create a
>> new list, and assign it to the name "x". It doesn't change the existing
>> list.
>>
> 
> Sounds strange.
> In perl

This is Python, not Perl. Please follow the links provided by Steven and 
read carefully.




More information about the Python-list mailing list