code: def pdf_zip(
      input1: str,
      input2: str,
      output: str,
      delete: bool = False,
      revert: bool = False,
  ):
      
      if os.path.isfile(output):
          ans = input(
              "The file '%s' already exists. "
              "Overwrite? Yes/Abort [Y/a]: " % output
          ).lower()
          if ans not in ["y", ""]:
              return
  
      outputfile = open(output, "wb")
      try:
          f1, f2 = open(input1, "rb"), open(input2, "rb")
          r1, r2 = PdfFileReader(f1), PdfFileReader(f2)
          writer = PdfFileWriter()
          pages1 = [page for page in r1.pages]
          pages2 = [page for page in r2.pages]
          if not revert:
              for p1, p2 in zip(pages1, pages2):
                  writer.addPage(p1)
                  writer.addPage(p2)
          else:
              for p1, p2 in zip(pages1, reversed(pages2)):
                  writer.addPage(p1)
                  writer.addPage(p2)
          writer.write(outputfile)
          f1.close()
          f2.close()
      except FileNotFoundError as e:
          print(e.strerror + ": " + e.filename)
      finally:
          outputfile.close()
  
      if delete:
          os.remove(input1)
          os.remove(input2)
docs: Zip pages of input1 and input2 in one output file. Useful for putting
      even and odd pages together in one document.
      :param input1: first input file
      :param input2: second input file
      :param output: output file
      :param delete: if true the input files will be deleted after zipping