Commit a3d8392f by BellCodeEditor

save project

parent ea3cf510
Showing with 3 additions and 1 deletions
...@@ -3,7 +3,7 @@ userpassword = "123456" ...@@ -3,7 +3,7 @@ userpassword = "123456"
i=3 i=3
while True: while True:
if i>=0: if i>=1:
name = input("请输入用户名:") name = input("请输入用户名:")
password = input("请输入密码:") password = input("请输入密码:")
if name == username and password == userpassword: if name == username and password == userpassword:
...@@ -11,6 +11,7 @@ while True: ...@@ -11,6 +11,7 @@ while True:
break break
if name != username and password != userpassword: if name != username and password != userpassword:
print("用户名,密码错误!请重新输入") print("用户名,密码错误!请重新输入")
i-=1 i-=1
else: else:
i-=1 i-=1
...@@ -18,6 +19,7 @@ while True: ...@@ -18,6 +19,7 @@ while True:
print("用户名错误!请重新输入") print("用户名错误!请重新输入")
if not password == userpassword: if not password == userpassword:
print("密码错误!请重新输入") print("密码错误!请重新输入")
print("机会:"+str(i))
else: else:
print("请100世纪后再试") print("请100世纪后再试")
exit() exit()
......
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