A neat way to iterate over two items of the same length

I assume this is memory effeicient.

for line1, line2 in zip(file('file1.txt'), file('file2.txt')):
    print line1, line2
Advertisements