λ_KxYdq 发表于 2019-3-27 22:03:23

小甲鱼课后题 密码检查

number = '1234578906'
specail = '''~!@#$%^&*()_=-/,.?<>;:[]{}|\'''
a = input('请输入要检查的密码')
leg = 0
head = 0
arm = 0
lenth = len(a)
if lenth <= 8:
    head = 1
    if 8<lenth<16:
      head = 2
      if 16 <= lenth:
            head =3
if a.isalnum() :
    leg = 1
for i in range(alphet):
    for j in range(number):
      for k in range(special):
            if i + j == a or i + k == a or j + k ==a:
                leg = 2
if list(a) in alphet:
    arm = 1
for i in range(alphet):
    for j in range(number):
      for k in range(special):
            if i + j + k ==a:
                leg = 3
if leg ==1 and head ==1:
    print('密码为低级密码')
if leg ==2 and head ==2:
    print('密码为中级密码')
if leg ==3 and head ==3 and arm ==1:
    print('密码为高级密码')
    求问大神哪里有问题, 新手学python 关于小甲鱼课后题的密码检测程序

jackz007 发表于 2019-3-27 22:39:34

      下面是问题语句,不符合 Python 语法
    if 8<lenth<16:
      应该改为这样:
if length > 8 and length < 16:
页: [1]
查看完整版本: 小甲鱼课后题 密码检查