You can download this code by clicking the button below.
This code is now available for download.
Compress two files into a single zip file.
Technology Stack : zipfile, os
Code Type : File compression
Code Difficulty : Intermediate
def zipfiles(file1, file2):
import zipfile
import os
with zipfile.ZipFile('output.zip', 'w') as zipf:
zipf.write(file1)
zipf.write(file2)
return 'output.zip'