Commit 09ffff42 by BellCodeEditor

save project

parent 5ab88987
Showing with 14 additions and 2 deletions
score = {'语文':91,'数学':88,'英语':85}
with open(r'C:\Users\玛酷\Desktop\yu.txt','r',encoding='utf-8') as file:
#file.write("小那:11本\n")
a=file.read()
print(a)
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
file= open(r'C:\Users\玛酷\Desktop\yu.txt','r',encoding='utf-8')
for i in file:
if "小兰" in i:
print("在")
else:
print("不在")
file=(r'C:\Users\玛酷\Desktop\yu.txt','w',encoding='utf-8')
file.write("小兰:12本")
file.close()
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