Commit 01956fde by BellCodeEditor

save project

parent 2a9e365b
Showing with 16 additions and 10 deletions
# # 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本' i=3
# a=open(r"D:\book.txt","w",encoding="utf-8") userpassword="123456"
# a.write("小兰:12本") username="python"
# a.close() while True:
if i>0:
with open(r"D:\book.txt","r",encoding="utf-8") as a: a=input("请输入账号")
for data in a: b=input("请输入密码")
if "小兰:12本" in data: i=i-1
print("数据在文件里") if a==username and b==userpassword:
\ No newline at end of file print("登录成功")
if a!=username:
print("账号错误")
print("")
if b!=userpassword:
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