Advertisement
Guest User

Untitled

a guest
Nov 25th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. from io import BytesIO
  2. from sys import stdin
  3. from zipfile import ZipFile
  4.  
  5. zip_from_stdin = ZipFile(BytesIO(bytes.fromhex(stdin.read())))
  6.  
  7. files_size = 0
  8. root_files_amount = 0
  9.  
  10. for file in zip_from_stdin.filelist:
  11.     files_size += file.file_size
  12.     if not file.is_dir():
  13.         root_files_amount += 1
  14.  
  15. print(root_files_amount, files_size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement