# 字母 if password.isalpha(): score += 0 elif password.islower() or password.isupper(): score += 10 else: score += 20
# 数字 if password.isdigit(): score += 0 eliflen([i for i in password if i.isdigit()]) >= 3: score += 20 else: score += 10
# 符号 iflen([i for i in password if i.isalnum()]) == 0: score += 0 eliflen([i for i in password ifnot i.isalnum()]) == 1: score += 10 else: score += 25
# 奖励 iflen([i for i in password if i.isalpha()]) > 0andlen([i for i in password if i.isdigit()]) > 0: score += 2 iflen([i for i in password if i.isalpha()]) > 0andlen([i for i in password if i.isdigit()]) > 0andlen( [i for i in password ifnot i.isalnum()]) > 0: score += 3 iflen([i for i in password if i.islower()]) > 0andlen([i for i in password if i.isupper()]) > 0andlen( [i for i in password if i.isdigit()]) > 0andlen([i for i in password ifnot i.isalnum()]) > 0: score += 5