title: Is there a better way to find if string contains digits?
body: <p>I'm working with strings that contain both digits and alphanumerics, or just digits, but not just alphas. In order to test for false matches, I need to check if the strings contain at least one digit, printing an error message if it doesn't. I have been using the following code:</p>
  
  <pre><code>s = '0798237 sh 523-123-asdjlh'
  
  def contains_digits(s):
      for char in list(s):
          if char.isdigit():
              return True
              break
      return False
  
  if contains_digits(s) == True:
      print s
  else:
      print 'Error'
  </code></pre>
  
  <p>Is there a more pythonic or simpler way to do so, or does this suffice? Also, I can't just check to see if the string is alphanumeric, because the string may contain various symbols ('-', spaces, etc.)</p>