Commit e1b60925 by BellCodeEditor

save project

parent ea2db008
Showing with 6 additions and 5 deletions
......@@ -2,9 +2,10 @@
#file=open(r"C:\Users\cc\Desktop\hongbao.txt","a",encoding="utf-8")
#file.write("小强:\n")
#file.write("稿贺:\n")
with open(r"C:\Users\cc\Desktop\hongbao.txt","w",encoding="utf-8")as file:
file.write("你简直就像我奶奶烤糊的苹果派一样\n")
file.write("你简直就像我奶奶烤糊的苹果派一样\n")
file.write("你简直就像我奶奶烤糊的苹果派一样\n")
with open(r"C:\Users\cc\Desktop\hongbao.txt","r",encoding="utf-8")as file:
for i in file:
#print(i)
if "苹果派" in i:
a=i.replace("苹果派","香蕉派")
print(a)
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