def isfirstdigit(str):# 1数字开头
if str[0].isdigit():return True
return False
def isother(str):# 3只能由大写小写数字
for x in str:
if x.isalnum()==False:return True
return False
def passwdtypenum(str):# 4密码种类
if isother(str):return 0
if str.islower() or str.isupper() or str.isdigit():return 1
return 2
def ispasswdlen(str):# 2密码长度
if 8 <= len(str) <= 100:return True
return False
def isTrue(str):# 是否符合上述要求
if isfirstdigit(str) or ispasswdlen(str) == False or isother(str) or passwdtypenum(str) <= 1:return False
return True
for i in range(int(input())): # n行
line = input() # 每一行
if isTrue(line):print('YES')
else:print('NO')
2018密码检查--答案
最新推荐文章于 2022-10-20 21:36:10 发布