Commit 8e3dbefd by BellCodeEditor

save project

parent 8a6d8345
Showing with 7 additions and 3 deletions
# 写入同学们的捐赠明细:小红:14 # 写入同学们的捐赠明细:小红:14
q=''
with open(r"C:\Users\lenovo\Desktop\sb.txt","r",encoding="utf-8")as s: with open(r"C:\Users\lenovo\Desktop\sb.txt","r",encoding="utf-8")as s:
for i in s: for i in s:
if '小红:14' in i: if '小红:14' in i:
print("在") i=i.replace('小红:14','小红:100')
\ No newline at end of file q+=i
with open(r"C:\Users\lenovo\Desktop\sb.txt","w",encoding="utf-8")as s:
s.write(q)
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