Iterating through THREE lists at once in Python?

Python3 answer:

for a, b, c in zip(lst1, lst2, lst3):
    ...

I do not quite understand the question, are you looking for

import itertools
for a, b, c in itertools.izip(lst1, lst2, lst3):
    ...

?

What izip does is it takes a variable number of arguments and returns an iterator that always yields the respective items of the arguments (a tuple of the first arguments in the first run, a tuple of the second arguments in the second run, and so on and so forth).

Tags:

Python

Maya