[Tutor] Help with a loop

PyProg PyProg pyprog05 at gmail.com
Tue Mar 18 16:23:47 CET 2008


Hello,

I have a little problem, I have two lists:

>>> a=[1, 2, 3, 4, 5, 6]
>>> b=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

... and I want to obtain:

>>> [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g',
1), ('h', 2), ('i', 3), ('j', 4)]

I want to obtain that with a comprehension-list.

Lists can have dimension completely different.

Can you help me please ?.

a+

-- 
http://ekd.tolosano.info


More information about the Tutor mailing list