next let' create the zip file make your program look like the following#python backuptozip py copies an entire folder and its contents into zip file whose filename increments --snip-while truezipfilename os path basename(folder'_str(numberzipif not os path exists(zipfilename)break number number create the zip file print( 'creating {zipfilename'backupzip zipfile zipfile(zipfilename' 'todowalk the entire folder tree and compress the files in each folder print('done 'backuptozip(' :\\delicious'now that the new zip file' name is stored in the zipfilename variableyou can call zipfile zipfile(to actually create the zip file be sure to pass 'was the second argument so that the zip file is opened in write mode step walk the directory tree and add to the zip file now you need to use the os walk(function to do the work of listing every file in the folder and its subfolders make your program look like the following#python backuptozip py copies an entire folder and its contents into zip file whose filename increments --snip-walk the entire folder tree and compress the files in each folder for foldernamesubfoldersfilenames in os walk(folder)print( 'adding files in {foldername'add the current folder to the zip file backupzip write(foldernameadd all the files in this folder to the zip file for filename in filenamesnewbase os path basename(folder'_if filename startswith(newbaseand filename endswith(zip')continue don' back up the backup zip files backupzip write(os path join(foldernamefilename)backupzip close(organizing files