Commit d4be7065 by BellCodeEditor

auto save

parent b00d9832
Showing with 21 additions and 3 deletions
i=3
username = "py"
userpassword = "123"
while True:
if i=>0:
name = input("请输入用户名")
password = input("请输入密码")
i -= 1
if username==name and userpassword==password:
print("登录成功!")
break
elif name!=username:
print("用户名请重新输入")
else password!=userpassword:
print("账户密码错误")
exit()
print("欢迎!")
\ No newline at end of file
...@@ -2,11 +2,11 @@ i=3 ...@@ -2,11 +2,11 @@ i=3
username = "python" username = "python"
userpassword = "123456" userpassword = "123456"
while True: while True:
if i>0:
name = input("请输入用户名:") name = input("请输入用户名:")
password = input("请输入密码:") password = input("请输入密码:")
i -= 1 i -= 1
if name == username and password == userpassword:
print("登录成功!") print("登录成功!")
break break
elif name!=username: elif name!=username:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment