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

Bob Gailer bgailer at alum.rpi.edu
Thu Mar 25 20:45:40 EST 2004


At 06:16 PM 3/25/2004, Gregor Lingl wrote:


>Bob Gailer schrieb:
>
>>....
>> >>> apply(zip, [ ('bob', 24, 457), ('mike', 20, 4567), ('steve', 30, 576)])
>>[('bob', 'mike', 'steve'), (24, 20, 30), (457, 4567, 576)]
>>
>This works also:
>
> >>> zip(('bob', 24, 457), ('mike', 20, 4567), ('steve', 30, 576))
>[('bob', 'mike', 'steve'), (24, 20, 30), (457, 4567, 576)]
>
>So in your case
>
> >>> zip(*[ ('bob', 24, 457), ('mike', 20, 4567), ('steve', 30, 576)])
>[('bob', 'mike', 'steve'), (24, 20, 30), (457, 4567, 576)]

Yah, Ich habe geschrieben und Zie Zind correct. I was trying to remember 
the * approach, my head would not deliver it in time.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625 home
720 938 2625 cell 




More information about the Tutor mailing list