From 080bccc0a62f157bc15817812f1f318c0bf09918 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 17 Sep 2022 16:26:57 +0800 Subject: [PATCH] save project --- diy2.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/diy2.py b/diy2.py index cf1e6b0..1992108 100644 --- a/diy2.py +++ b/diy2.py @@ -1,14 +1,18 @@ username = "python" userpassword = "123456" while True: - name = input("请输入用户名:") - password = input("请输入密码:") - if name == username and password == userpassword: - print("登录成功!") - break - if username != name: - print("用户不存在!请重新输入") - continue - if userpassword != password: - print(密码错误!请重新输入) -print("欢迎来到贝尔编程!") \ No newline at end of file + if i>0: + name = input("请输入用户名:") + password = input("请输入密码:") + if name == username and password == userpassword: + print("登录成功!") + print("欢迎来到贝尔编程!") + break + if username != name: + print("用户不存在!请重新输入") + continue + if userpassword != password: + print(密码错误!请重新输入) + else: + print("以后再来") + break -- libgit2 0.25.0