[a,b,c,d] = 1,2,3,4

Cody Piersall cody.piersall at gmail.com
Tue Aug 25 10:32:51 EDT 2015


On Tue, Aug 25, 2015 at 9:16 AM, ast <nomail at invalid.com> wrote:

> [a,b,c,d] = 1,2,3,4
>>>> a
>>>>
>>> 1
>
>> b
>>>>
>>> 2
>
>> c
>>>>
>>> 3
>
>> d
>>>>
>>> 4
>
> I have never seen this syntax before. Is it documented.
> Is there a name for that ?
>
> thx
> --
> https://mail.python.org/mailman/listinfo/python-list
>

That's called "sequence unpacking"

Cody
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150825/015a849b/attachment.html>


More information about the Python-list mailing list