[Tutor] Is this a job for zip(), or some other way?

Karl Pflästerer sigurd at 12move.de
Thu Mar 25 19:45:09 EST 2004


On 26 Mar 2004, R. Alan Monroe <- amonroe at columbus.rr.com wrote:

>>  >>> apply(zip, [ ('bob', 24, 457), ('mike', 20, 4567), ('steve', 30, 576)])
>> [('bob', 'mike', 'steve'), (24, 20, 30), (457, 4567, 576)]

> Slick, exactly what I had in mind.

Or if you want to be really modern:

>>> zip(* [('bob', 24, 457), ('mike', 20, 4567), ('steve', 30, 576)])
[('bob', 'mike', 'steve'), (24, 20, 30), (457, 4567, 576)]



   Karl
-- 
Please do *not* send copies of replies to me.
I read the list




More information about the Tutor mailing list