Commit 01956fde by BellCodeEditor

save project

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