#密码强度算法 #1、长度大于八位#2、有字母、数字、特殊符号组成(判断字母数字。isalnum() string.punctuation)#符合其中一个条件 密码强度为低#两个条件都符合 密码强度为高 import stringpwd = "asdad123456/./"passwd_strong = 0strpun = ""if len(pwd) > 8: passwd_strong += 1for i in pwd: if i.isalnum(): strpun += "1" elif i in string.punctuation: strpun += "2"if "1" in strpun and "2" in strpun: passwd_strong +=1if passwd_strong == 1: print("密码强度为弱")elif passwd_strong == 2: print("密码强度为强")else: print("您输入的不符合标准")