diy2.py
459 Bytes
a=0
username = "1"
userpassword = "1"
while True:
a = input("请输入用户名:")
b = input("请输入密码:")
a+=1
if a == username and b == userpassword:
break
print("登录成功!")
else:
if b !=userpassword:
print("账号错")
if a !=username:
print("密码错")
if a==3:
print("你的帐号被锁定")
exit()
print("欢迎来到贝尔编程!")