List sequential initialization

Chris Mellon arkanes at gmail.com
Tue Jun 12 16:26:34 EDT 2007


On 6/12/07, HMS Surprise <john at datavoiceint.com> wrote:
> Thanks for the explaination. It didn't seem natural and from the
> tutorial I read:
>
>     A value can be assigned to several variables simultaneously:
>
>     >>> x = y = z = 0  # Zero x, y and z
>
>
> Maybe I infer too much....
>

And yet, your answer is right there.

"A value can be assigned to several variables simultaneously"

When you say want a value assigned to several variables, Python
doesn't assume that you actually mean you want 2 different values
assigned to them.



More information about the Python-list mailing list