title: How to check if the string has digits without a try/except or str.isdigit?
body: <pre><code>NUMBERS = "123456789"
  
  def digit_checker(x):
  
      for t in  x:
          if t  in NUMBERS:
             y = True
          else:
             y = False
      return y
  
  
  
   sentence = input("Enter a string to check if its all digits: ")
   checker = digit_checker(sentence)
   print(checker)
  </code></pre>
  
  <p>As the title states, how would I find if the string has all digits without using the <code>str.isdigit</code> or a <code>try/except</code>. The code keeps checking the first character and not all. How do I fix that?</p>