title: how to check for numbers in a string recursively in python
body: <p>I am trying to make a script that recursively check for numbers, for example to check if the the two strings have the same amount of a certain digit. This is what I have so far:</p>
  
  <pre><code>while(x&lt;9):
      n = str(x)
      if a.count(n) == b.count(n):
          cow=+1    
      x+=1
  </code></pre>
  
  <p>However, this recurs and doesn't return the function that it was in.</p>