You can download this code by clicking the button below.
This code is now available for download.
This function reads two files line by line and prints them corresponding to each other.
Technology Stack : Built-in libraries
Code Type : File operation
Code Difficulty : Intermediate
def zipfiles(file1, file2):
with open(file1, 'rb') as f1, open(file2, 'rb') as f2:
for line1, line2 in zip(f1, f2):
print(line1.decode(), line2.decode())