I tried this and I got:

[(1, 'a'), (2, 'b'), (3, 'c')]

But if I change:

a=[1,2]

I got:

[(1, 'c')]

Why is that?  I thought I should be getting:

[(1, 'a'),(2,'b')]

?????


"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> zip or izip is your friend:
>
> import itertools
>
> a = [1,2,3]
> b = ['a', 'b', 'c']
>
> for a,b in itertools.izip(a, b):
>     print a, b
>
> -- 
> Regards,
>
> Diez B. Roggisch


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to