title: Find the number of times a word occurs in a string
body: <p>So for example if I want to know the number of times hello occurs in this word: <code>hellohellothere</code>, my code will give me <code>2</code> which is correct. But if I were to have <code>hellotherehello</code>, my code does not give me <code>2</code>, which means I think there is something wrong with my second for loop.</p>
  
  <p>My code counts the number of letters in the string, and then I divide it by the length of the string to give how many times the string actually occurs, I don't think that really is the problem though. </p>
  
  <p>here is the code. </p>
  
  <pre><code>word = input("Enter a word: ")
  find = input("Enter string to find")
  count = int(0)
  
  for x in range(0, len(word)-len(find)):
      if word[x] == find[0]:
          for i in range(0, len(find)):
              if word[x+i] == find[i]:
                  count += 1
              else:  break
  
      count = count/len(find)
  
      print("Number of times it occurs is: ", count) 
  </code></pre>