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.
The weak and strong work however the medium does not.
I do not know where I have gone wrong.
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) >12:
print ('password is too long It must be between 6 and 12 characters')
elif len(password) <6:
print ('password is too short It must be between 6 and 12 characters')
elif len(password) >=6 and len(password) <= 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)