你看一下你最后 if 哪里,根本没有调用 isdigit 和 isalpha 方法,要加括号的,第 19 行print("请输入需要检查的密码组合:", end="")
# secret = input()
secret = 'aaaaaaaaaaaa111111!!!!!'
length = len(secret)
while True:
if secret.isdigit() or secret.isalpha() or length <= 8:
print("您的密码评级为:低")
break
if secret.isalnum() or length < 16:
print("你的密码评级为:中")
break
secretson = [i for i in secret if
not i in ["~", "!", "@", "%", "^", "&", "*", "(", ")", "_", "=", "-", "/", ",", ".", "?", "<", ">",
";", ":", "[", "]", "{", "}", "/", "\"]]
a = ""
print(secretson)
secretson1 = a.join(secretson)
print(secretson1)
if secretson1.isdigit() or secretson1.isalpha():
print("你的密码评级为:中")
break
else:
print("你的密码评级为:高")
print("继续保持")
break
|