title: Os.walk - count files in same subdirectory of parent directories
body: <p>I'm trying to count the number of files in a specific folder, throughout a large number of parent directories. Each Project contains the same folder structure:</p>
  
  <pre><code>C:/Projects
      2019
          Project A
              Communication
                  Images
          Project B
              Communication
                  Images
          ...
      2018
          ...
  </code></pre>
  
  <p>Below is my attempt</p>
  
  <pre><code>base_dir = 'C:/Projects/'
  years = ['2019', '2018', '2017']
  image_folder = '/Communication/Images'
  
  project_list = []
  for project in project_list:
      for year in years:
          target_folder = base_dir + year + project + image_folder
          for root, dirs, files in os.walk(folder):
              total += len(files)
  
  # Print to CSV etc
  </code></pre>
  
  <p>First, I need to get a list of all paths to the image folder. What I'm struggling with understanding (even to get an attempt to work) is that os.walk takes in root, dir, files. Can os.walk do exactly what I need without getting into possibly 3 for loops? There are a LOT of files which I intend to count so I want to make sure I'm not taking a hit on performance by structuring it like I have</p>