List transpose method

Steve Holden sholden at holdenweb.com
Fri Nov 2 08:03:00 EST 2001


"Tom Harris" <TomH at optiscan.com> wrote in message
news:mailman.1004650983.10335.python-list at python.org...
> Hi,
>
> Suppose I have a list like ((1,2), (3,4), (5,6)). Can some functional guru
> tell me a one liner to transpose this to the form ((1,3,5),(2,4,6))? I can
> only come up with an ugly multiliner.
>
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81190

works with lists, as the subject line requested. Turning them into tuples is
left as an exercise for the reader ...

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list