Commit 5d20a15c by BellCodeEditor

save project

parent 760af245
Showing with 9 additions and 7 deletions
...@@ -2,18 +2,20 @@ i = 3 ...@@ -2,18 +2,20 @@ i = 3
username = "python" username = "python"
userpassword = "123456" userpassword = "123456"
while True: while True:
if i=0: if i>0:
name =("请输入用户名:") name = input("请输入用户名:")
password = input("请输入密码:") password = input("请输入密码:")
i=-1 i-=1
if name == username and password == userpassword: if name == username and password == userpassword:
break break
print("登录成功!") print("登录成功!")
if username != name: if username != name:
print("账号不匹配") print("账号不匹配")
if username != password print("还有" +str(i)+"次机会")
continue continue
print("密码不匹配") if userpassword != password:
print("密码不匹配")
print("还有" +str(i)+"次机会")
else: else:
print("机会用完了") print("机会用完了")
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