title: Python - Check if a string contains a digit
body: <p>I am making a function that uses a while True loop to ask the user to input a password that passes the criteria; min8-15max characters in length and includes at least one integer. I am stumped on how to properly check the input for an integer.</p>
  
  <p>My program:</p>
  
  <pre><code>def enterNewPassword():
      while True:
          pw = input('Please enter a password :')
          for i in pw:
              if type(i) == int:
                  if len(pw) &gt;= 8 and len(pw) &lt;= 15:
                      break
          if int not in pw:
              print('Password must contain at least one integer.')
          if len(pw) &lt; 8 or len(pw) &gt; 15:
              print('Password must be 8 and no more than 15 characters in length.')
      return pw
  </code></pre>