You can download this code by clicking the button below.
This code is now available for download.
The function takes two files and returns a list containing the corresponding bytes of the two files, compressed in a zip-like manner.
Technology Stack : Built-in libraries
Code Type : File processing
Code Difficulty : Intermediate
def zip_file(file1, file2):
with open(file1, 'rb') as f1, open(file2, 'rb') as f2:
zipped = zip(f1, f2)
return list(zipped)