Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 检查密码保险库的长度_Python_Python 3.x - Fatal编程技术网

Python 检查密码保险库的长度

Python 检查密码保险库的长度,python,python-3.x,Python,Python 3.x,更新的错误代码,现在可以成功检查输入值和最大值和最小值更新的错误代码,现在可以成功检查输入值和最大值和最小值更新的错误代码,现在可以成功检查输入值和最大值和最小值 print("------------------------------------------------------------------------") print('''Welcome to password Locker, a place where you can store all your passwords t

更新的错误代码,现在可以成功检查输入值和最大值和最小值更新的错误代码,现在可以成功检查输入值和最大值和最小值更新的错误代码,现在可以成功检查输入值和最大值和最小值

print("------------------------------------------------------------------------")
print('''Welcome to password Locker, a place where you can 
store all your passwords to easily enter your precious accounts without
hassle.''')
print("------------------------------------------------------------------------")



print('''First lets make an account,''')

while True:
    first_name = input('''What is your first name?''')
    if first_name.isdigit():  #isdi
        print("No numbers")
    else:
        print("Eligible")
        break

while True:
        sur_name = input('''What is your surname?''')
        if sur_name.isdigit():  #isdi
            print("No numbers")
        else:
            print("Eligible")
            break

print('''----------------------------------''')
print('''Welcome, {} {} 
what would you like your username to be, it should be something 
memorable and no longer than ten characters long'''.format(first_name, sur_name))
while True:
        username = input("")
        if 0 < len(username) < 10:
                print('''Nice, username''')
                break
        elif not username:
            pass

        else:
            print('''Your username should be a maximum of 10 charecters''')
while True:
    locker_password = input('''Now it's time to setup a password for your locker: ''')
    if len(locker_password) > 4 and len(locker_password) < 11:

        print('''{}, is locked in thanks for joining Password Locker'''.format(locker_password))       
    else:
        print("It should be between 4 and 10 charecters long!")```


  [1]: https://i.stack.imgur.com/4JnoH.png
print(“---------------------------------------------------------------------------------------”)
打印(''欢迎来到密码锁,一个你可以
储存您的所有密码,无需密码即可轻松进入您的宝贵帐户
麻烦。”“”)
打印(“--------------------------------------------------------------------------------------”)
打印(''首先让我们创建一个帐户,'')
尽管如此:
first_name=输入(''你的名字是什么?'')
如果first_name.isdigit():#isdi
打印(“无编号”)
其他:
打印(“合格”)
打破
尽管如此:
sur_name=input(''你姓什么?'')
if sur_name.isdigit():#isdi
打印(“无编号”)
其他:
打印(“合格”)
打破
打印('''--------------------------------------'')
打印(''欢迎,{}{}
您希望您的用户名是什么,应该是什么
令人难忘且长度不超过十个字符的“”。格式(名字、姓氏))
尽管如此:
用户名=输入(“”)
如果04且len(锁定密码)<11:
打印(“{},已锁定,感谢您加入密码锁”“。格式(锁存密码))
其他:
打印(“长度应在4到10个字符之间!”)```
[1]: https://i.stack.imgur.com/4JnoH.png

添加一个条件并
elif
,如果
条件有一点,则修改

username = input('''Welcome, {} {} 
what would you like your username to be, it should be something 
memorable and no longer than ten characters long
'''.format(first_name, sur_name))
while True:
        username = input()
        if 0 < len(username) < 10:
                print('''Nice, username''')
                break
        elif not username:
            pass

        else:
            print('''Your username should be a maximum of 10 charecters''')

添加并
elif
一个条件,并稍微修改
if
条件:

username = input('''Welcome, {} {} 
what would you like your username to be, it should be something 
memorable and no longer than ten characters long
'''.format(first_name, sur_name))
while True:
        username = input()
        if 0 < len(username) < 10:
                print('''Nice, username''')
                break
        elif not username:
            pass

        else:
            print('''Your username should be a maximum of 10 charecters''')


将该
继续
替换为
中断
,如果用户名!=“:
check.@Aran Fey替换了它,但它仍然重新提出了问题,而不是说下面的消息”`else:print(''您的用户名最多应该是10个字符')```你输入了什么用户名?@Aran Fey我输入了一个大于10个字符的新代码。新代码运行正常。用
中断
替换该
并添加
如果用户名!=“:
检查。@Aran Fey替换了它,但它仍然重新提出了问题,而不是说下面的信息:``其他:打印(''您的用户名最多应为10个字符')``您输入了什么用户名?@Aran Fey我输入了一个大于10个字符的新代码工作正常。您好@U9 Forward,我把你的代码放进去了,但仍然没有打印你的用户名最多应该是10个字符。我的其他代码可能有问题吗?@hobo你能复制整个代码,然后再试一次吗?我确实把整个代码放进去了,但仍然没有显示消息,只是重复了messege@hobo真奇怪,这对我来说很好,只是在我的整个代码中,希望能帮助@U9前进,我把你的代码放在里面了,但仍然没有打印你的用户名最多应该是10个字符。我的其余代码可能有问题吗?@hobo你能复制整个代码并重试吗?我确实把整个代码放在里面了,但仍然没有显示消息,只是重复一下messege@hobo这很奇怪,它对我来说很好,只是我用了我的全部代码,希望能帮上忙