unzip function?

Rodrick Brown rodrick.brown at gmail.com
Wed Jan 18 10:31:02 EST 2012


On Wed, Jan 18, 2012 at 10:27 AM, Alec Taylor <alec.taylor6 at gmail.com>wrote:

> http://docs.python.org/library/functions.html
> >>> x = [1, 2, 3]
> >>> y = [4, 5, 6]
> >>> zipped = zip(x, y)
> >>> zipped
> [(1, 4), (2, 5), (3, 6)]
> >>> x2, y2 = zip(*zipped)
> >>> x == list(x2) and y == list(y2)
> True
>

Alec can you explain this behavior zip(*zipped)?

> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120118/50b3ff19/attachment-0001.html>


More information about the Python-list mailing list