Multiple assignment behaves unexpectedly (was: Help ! newbie problem)

ferdydurke ferdy at ferdy.com
Fri Dec 26 15:37:49 EST 2003


Rene Pijlman wrote:

> ferdydurke:
>>...     a,b,c = b,a+b,c+1
> 
> b is set to a + b.
> 
> [...]
>>...     a=b
>>...     b=a+b
>            ^
>       This a has a different value now, because of the previous statement.
> So this sets b to b + b.
> 


thanks a lot for the reply, I gotcha now




More information about the Python-list mailing list