题解 | #密码强度等级#
https://www.nowcoder.com/practice/52d382c2a7164767bca2064c1c9d5361
"""
思路:将五个等分版块成绩汇总即可
技巧:将字符串中既不是字母也不是数字的判为其它符号
"""
s = input()
res = 0 # 总成绩初始赋0
# 1.长度
if len(s) >= 8:
res += 25
elif len(s) >= 5:
res += 10
else:
res += 5
# 字母,数字,符号分类
la = [] # 是否是字母的列表
lu = [] # 是否是大写字母的列表
ll = [] # 是否是小写字母的列表
ld = [] # 是否数字的列表
lo = [] # 是否是其它号的列表
for i in s:
if i.isalpha():
la.append(1)
if i.isupper():
lu.append(1)
elif i.islower():
ll.append(1)
elif i.isdigit():
ld.append(1)
else:
lo.append(1)
# 2.字母
if sum(ld) == len(s):
res += 0
elif sum(lu) == sum(la) or sum(ll) == sum(la):
res += 10
else:
res += 20
# 3.数字
if sum(ld) == 1:
res += 10
elif sum(ld) > 1:
res += 20
else:
res += 0
# 4.符号(将既不是字母也不是数字的归为其它符号)
if len(lo) == 1:
res += 10
elif len(lo) > 1:
res += 25
else:
res += 0
# 5.奖励
if (len(lu) > 0) and (len(ll) > 0) and (len(ld) > 0) and (len(lo) > 0):
res += 5
elif (len(lu) + len(ll) > 0) and (len(ld) > 0) and (len(lo) > 0):
res += 3
elif (len(lu) + len(ll) > 0) and (len(ld) > 0):
res += 2
else:
res += 0
# 输出结果
if res >= 90:
print("VERY_SECURE")
elif res >= 80:
print("SECURE")
elif res >= 70:
print("VERY_STRONG")
elif res >= 60:
print("STRONG")
elif res >= 50:
print("AVERAGE")
elif res >= 25:
print("WEAK")
else:
print("VERY_WEAK")


