print('please input your password:',end=" ")
temp=input()
zimu='abcdefghijklmnopqrstuvwxyz'
zifu="~,!,@,#,$,%,^,&,*,(,),-,=,_,\,/,,.,?,<,>,;,:,[,],{,},|,"
numbers=(1,2,3,4,5,6,7,8,9,)
tempstart=temp[:1]
length=len(temp)
while (length==0) or(temp.isspace()):
print('你输入的密码为空,请重新输入:',end='')
temp=input()
for each in temp:
if (each in zimu )and (each in zifu) and (temp.len()>=16)and (tempstrat.isalpha())and(each in numbers)and(length>=16):
print('安全等级为高,请继续保持')
break
elif ((each in zimu)and(each in zifu)or(each in numbers)and(each in zimu)or(each in numbers)and(each in zifu))and(length>=8):
print('安全等级为中,可以按以下要求提高密码安全等级:\n1.密码必须由数字、字母及特殊字符\n2.密码只能由字母开头\n3.密码长度不低于16位')
break
elif(each in numbers)or(each in zimu)and(length<=8):
print('安全等级为低,可以按以下要求提高密码安全等级:\n1.密码必须由数字、字母及特殊字符\n2.密码只能由字母开头\n3.密码长度不低于16位')
break
else:
print('您输入的密码格式有误,请重新输入:',end="")
temp=input()