牛客网算法题——密码检查

Python代码:

n=int(input())
for i in range(n):
    key=input()
    count=1
    if key.isalnum()==False:
        count=0
    elif key[0].isdigit()==True:
        count=0
    elif key.islower()==True or key.isupper()==True or key.isdigit()==True:
        count=0
    elif len(key)<8 or len(key)>100:
        count=0
    if count:
        print("YES")
    else:
        print("NO")

猜你喜欢

转载自blog.csdn.net/hitzijiyingcai/article/details/87561642