title: Checking the strength of a password (how to check conditions)
body: <p>I am trying to create a system that requires you to enter a password. If it is all lower, upper or num then print weak, if it is two of the conditions, then it is med and if all have been met it is strong. It just does not seem to work. </p>
  
  <p>The weak and strong work however the medium does not.</p>
  
  <p>I do not know where I have gone wrong.</p>
  
  <pre><code>def password():
  
      print ('enter password')
      print ()
      print ()
      print ('the password must be at least 6, and no more than 12 characters long')
      print ()
  
      password = input ('type your password    ....')
  
  
      weak = 'weak'
      med = 'medium'
      strong = 'strong'
  
      if len(password) &gt;12:
          print ('password is too long It must be between 6 and 12 characters')
  
      elif len(password) &lt;6:
          print ('password is too short It must be between 6 and 12 characters')
  
  
      elif len(password)    &gt;=6 and len(password) &lt;= 12:
          print ('password ok')
  
          if password.lower()== password or password.upper()==password or password.isalnum()==password:
              print ('password is', weak)
  
          elif password.lower()== password and password.upper()==password or password.isalnum()==password:
              print ('password is', med)
  
          else:
              password.lower()== password and password.upper()==password and password.isalnum()==password
              print ('password is', strong)
  </code></pre>