Commit 1bad4756 by BellCodeEditor

save project

parent 56063ef3
Showing with 10 additions and 8 deletions
file = open(r'C:\Users\Administrator\Desktop\book.txt','w',encoding='utf-8')
file.write('小兰:12本\n')
file.write('小丽:11本\n')
file.write('李文:9本\n')
file.write('张伟:16本\n')
file.close()
\ No newline at end of file
username = "python" username = "python"
userpassword = "123456" userpassword = "123456"
i = 3
while True: while True:
if i < 1:
print("次数用完,登陆失败")
break
name = input("请输入用户名:") name = input("请输入用户名:")
password = input("请输入密码:") password = input("请输入密码:")
if username != name: if username != name:
print("账号错误") print("账号错误")
elif password != userpassword: continue
if password != userpassword:
print("密码错误") print("密码错误")
else: if name == username and password == userpassword:
print("登录成功!") print("登录成功!")
break break
i -= 1
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