Commit 370443ec by BellCodeEditor

auto save

parent e6e64ab1
Showing with 13 additions and 20 deletions
username = "python"
userpassword = "123456" #int
userpassword = "123456"
num = 3
while True:
if num>0:
uname = input("输入账号:")
upass = input("输入密码:")#通过input()输入的所有数据,都是str(字符串)
num-=1
if uname == username and upass == userpassword:
print("登入成功!")
break
if uname != username:
print("账号错误!")
else:
if upass != userpassword:
print("密码错误!")
else:
print("账户锁定!")
exit()
print("欢迎回来!")
\ No newline at end of file
name = input("输入账号:")
password = input("输入密码:")
if name == username and password == userpassword:
print("登入成功!")
break
if name == username:
print("账号错误!")
if password == userpassword:
print("密码错误!")
print("登入失败!")
\ No newline at end of file
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