title: How to count total number of files in each subfolder
body: <p>My file structure looks like this:</p>
  <pre class="lang-none prettyprint-override"><code>- Outer folder
    - Inner folder 1
      - Files...
    - Inner folder 2
      - Files...
    - …
  </code></pre>
  <p>I'm trying to count the total number of files in the whole of Outer folder. <code>os.walk</code> doesn't return any files when I pass it the Outer folder, and as I've only got two layers I've written it manually:</p>
  <pre class="lang-py prettyprint-override"><code>total = 0
  folders = ([name for name in os.listdir(Outer_folder)
              if os.path.isdir(os.path.join(Outer_folder, name))])
  for folder in folders:
      contents = os.listdir(os.path.join(Outer_folder, folder))
      total += len(contents)
  print(total)
  </code></pre>
  <p>Is there a better way to do this? And can I find the number of files in an arbitrarily nested set of folders? I can't see any examples of deeply nested folders on Stack Overflow.</p>
  <p>By 'better', I mean some kind of built in function, rather than manually writing something to iterate - e.g. an <code>os.walk</code> that walks the whole tree.</p>