Writing a password verification program, password format containing uppercase, lowercase letters, numbers, length 8

get_passwords DEF (): 
password = INPUT ( 'Enter a password:' Strip ().)
list_lower = []
list_upper = []
list_digit = []
IF len (password)> 0:
IF len (password) ==. 8:
K in password for:
IF k.isdigit ():
list_digit.append (K)
elif k.islower ():
list_lower.append (K)
elif k.isupper ():
list_upper.append (K)
the else:
Print ( 'no ! do anything ')
IF len (list_upper)> 0 and len (list_lower)> 0 and len (list_digit)> 0:
Print ('! entered password OK ')
the else:
print ( 'password entered does not meet the requirements, the password must contain a combination of uppercase, lowercase, digits')
the else:
print ( 'length is not 8-bit input password, please reenter!')
elif len (password) == 0:
print ( 'password can not be empty!')
the else:
print ( 'such a situation does not exist!')


get_passwords ()

Guess you like

Origin www.cnblogs.com/laosun0204/p/11131428.html