list assignment

Raymond Hettinger python at rcn.com
Wed Feb 22 15:47:55 EST 2006


>      [spam, ham] = ['yum', 'YUM']
>
> I don't see how this is any different than a tuple unpacking assignment:
>
>      >>> a, b = 1, 2

It's not different.  They are ways of writing the same thing.


Raymond Hettinger




More information about the Python-list mailing list