title: How to check the validity of a password (input from users) without using import re?
body: <p>I'm trying to check the validity of a password without using <code>import re</code>, but it always gives me not valid. Where is my error, please?</p>
  
  <pre><code>password = input('Enter your password: ')
  
  while True:
      if password not in [i for i in range(0,9)]:
          print('not valid')
          break
      elif (len(password)&lt;6 or len(password)&gt; 9):
          print('not valid')
          break
      elif password not in [chr(c) for c in range(97, 123)]:
          print('not valid')
          break
      elif password not in [chr(c) for c in range(65, 91)]:
          print('not valid')
          break
      elif password not in ('$','#','@'):
          print('Not valid')
          break
      else:
          print('Valid')
          break
  </code></pre>