title: How to count number of words inside a string using a for loop in python 3
body: <p>I am trying to write a for loop that finds a specific word inside a string. I know that there is a one liner to do this in python, but I am practicing the for loops and I want to see how using a for I can identify specific words as it identifies especific letters (like vowels). I've been reading some questions, and I think the code should go like this:</p>
  
  <pre><code>s='bananasdasdnansbanana'
  b='banana'
  def count_words(s,b):
      answer = 0
      for i in range(len(s)):
          if any(s[i:].startswith(b) for b in s):
             answer += 1
      print(answer)
  </code></pre>
  
  <p>but it is not printing anything. I did something similar when I was looking for vowels in the same string, but now I know I am supouse to "arrange" the characters in the word "banana" and then comparate it to the string, that is the porpuse of this part:</p>
  
  <pre><code>if any(s[i:].startswith(b) for b in s):
  </code></pre>
  
  <p>if you could help me I would really apreciate it.</p>
  
  <p>Thank you.</p>