def check(passpword):
c=0
if not password.isalnum():
c+=1
for i in password:
if '0'<=i<='9':
c+=1
break
for i in password:
if 'a'<=i<='z' or 'A'<=i<='Z':
c+=1
break;
return c
def waring():
print('请按照以下方式提升安全级别:')
print('\t1.密码必须由数字、字母及特殊字符三种组合')
print('\t2.密码只能由字母开头')
print('\t3.密码长度不能低于16位')
while True:
password=input('请输入需要检测的密码组合:')
l=len(password)
if l==0:
print('密码不能为空!')
continue
if '0'<=password[0]<='9':
print('密码不能以数字开头!')
continue
print()
g=check(password)
if g==1 or l<8:
print('您的密码安全级别评定为:低')
waring()
elif g==2 and l>=8 or g==3 and l<16:
print('您的密码安全级别评定为:中')
waring()
elif g==3 and l>=16:
print('您的密码安全级别评定为:高')
print('请继续保持')
print()