title: Returns a count of the number of words in the string that contain length characters
body: <p>I am a few weeks into learning python properly and couldn't find a way to proceed from what I currently have. The question is:</p>
  <blockquote>
  <p>Write a function num_words(string, length) that takes a string argument and returns a count of the number of words in the string that contain length characters. If there are no words of the given length then 0 should be returned.
  A word is defined as a maximal-length sequence of characters other than &quot;white space&quot; characters.
  Hint: use the split method of a string.</p>
  </blockquote>
  <p>I currently have:</p>
  <pre><code>def num_words(string, length):
      &quot;&quot;&quot;Takes a string argument and returns a count of the 
      number of words in the string that contain length characters&quot;&quot;&quot;
      result = ()
      for strings in string:
          for letters in strings:
              len(letters.split(string))
              return letters
      
  word_count = num_words(&quot;Oh no it's a list filter!&quot;, 2)
  print(word_count)
  word_count = num_words(&quot;Oh no its a list filter!&quot;, 4)
  print(word_count)
  </code></pre>
  <p>The output is</p>
  <pre><code>0
  0
  </code></pre>
  <p>What it should output:</p>
  <pre><code>2
  1
  </code></pre>
  <p>Using these tests:</p>
  <pre><code>word_count = num_words(&quot;Oh no it's a list filter!&quot;, 2)
  print(word_count)
  
  word_count = num_words(&quot;Oh no its a list filter!&quot;, 4)
  print(word_count)
  </code></pre>
  <p>I think you have to use a nested for loop with len and split function but don't know how to find the length of letters in a word and then return that with the corresponding length. A full answer will be appreciated :)</p>