python--学习--用户名和密码验证
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python--学习--用户名和密码验证相关的知识,希望对你有一定的参考价值。
#!/usr/bin/python3
user=‘whoooo‘
password="1234567"
name=input("请输入用户名:")
namepasswd=input("请输入密码:")
count1=1
count2=1
while name!=user :
print("careful ,you can only input 3 times,you have already iput ",count1,"times")
if count1<3:
name=input("请输入用户名:")
count1=count1+1
else:
print("you have already input 3 times,you have been permissed")
break
else:
while namepasswd!=password :
print("careful ,you can only input 3 times,you have already iput ",count2,"times")
if count2<3:
namepasswd=input("请输入密码:")
count2=count2+1
else:
print("you have already input 3 times,you have been permissed")
break
else:
print("welcome to mange your system")
以上是关于python--学习--用户名和密码验证的主要内容,如果未能解决你的问题,请参考以下文章