title: Python - find digits in a string
body: <pre><code>def get_digits(str1):
      c = ""
  
      for i in str1:
          if i.isdigit():
              c += i
              return c
  </code></pre>
  
  <p>Above is the code that I used and the problem is that it only returns only the first digit of strings. For this, I have to keep both for loop and return statement. Anyone knows how to fix?</p>
  
  <p>Thanks.</p>