with open('file1.txt','r') as f1, open('file2.txt','r') as f2:
for line1, line2 in zip(f1, f2):
if line1 != line2:
print(line1,'\n',line2)
with open('file1.txt','r') as f1, open('file2.txt','r') as f2:
for line1, line2 in zip(f1, f2):
if line1 != line2:
print(line1,'\n',line2)