title: Counting number of files with different formats in zip file using Python
body: <p>I have lot of zipped files in my directory, I want to get number of files for each zip file. For instance, let's say for the zip file "nature.zip", I want to get following output:</p>
  
  <pre><code>file_name   file_format
  nature      jpg 2, png 1 
  </code></pre>
  
  <p>So far I managed to print the content but don't know how could I move forward</p>
  
  <pre><code>    from zipfile import ZipFile
      import os
      directory = r"C:\Users\Lenovo\data_2"
      for folder, subfolders, files in os.walk(directory):
          for file in files:
              if file.endswith(".zip"):
                  # opening the zip file in READ mode
                  with ZipFile(directory+ '/'+ file, 'r') as zip:
                      # printing all the contents of the zip file
                      zip.printdir()
  </code></pre>
  
  <p>Thank you very much</p>