diy2.py
538 Bytes
i=3
username = "python"
userpassword = "123456"
while True:
if i>0:
a = input("请输入用户名")
b = input("请输入密码")
i-=1
if a == username and b == userpassword:
print("登录成功!")
break
if a!=username:
print("用户名错误!请重新输入")
continue
if b!=usdrpassword:
print("密码错误")
else:
print("不好意思你没机会里")
exit()
print("欢迎来到贝尔编程!")