Iteration over two sequences

Diez B. Roggisch deetsNOSPAM at web.de
Wed Jan 12 11:00:08 EST 2005


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



More information about the Python-list mailing list