X=['~','!','@','#',','%','^','&','*','(',')','_','=','-','/',',','.','?','<','>',';',':','[',']','{','}','|','\\']
Y=['1','2','3','4','5','6','7','8','9','0']
Z=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','u','s','t','u','v','w','x','y','z']
while True:
passwords=input('请输入注册密码:')
flagx = False
flagy = False
flagz = False
print(flagx,flagy,flagz)
for each in passwords:
if each in X:
flagx = True
elif each in Y:
flagy = True
elif each in Z:
flagz = True
print(flagx,flagy,flagz)
if len(passwords)>= 16 and flagx and flagy and flagz and passwords[0] in Z:
print('密码安全等级:高')
elif 8<=len(passwords)<= 16 and (flagx + flagy +flagz ==2) :#判断符合2种规则
print('密码安全等级:中')
elif len(passwords)<8 and passwords.isdigit()==True:
print('密码安全等级:低')
else:
print('其他类型的密码')