# Python 3 for f, b in zip(foo, bar): print(f, b) # Python 2 import itertools for f, b in itertools.izip(foo, bar): print(f,b) # zip and izip stop when the shorter of foo or bar stops.