Commit 21864630 by BellCodeEditor

save project

parent 4e6e2118
Showing with 2 additions and 2 deletions
......@@ -9,8 +9,7 @@ sr=''
with open(r'C:\Users\Administrator\Desktop\book.txt','r',encoding='utf-8')as file1:
for i in file1:
if "小强: 12本" in i:
i.replace("小强: 12本","小强: 14本")
print(i)
i=i.replace("小强: 12本","小强: 14本")
sr+=i;
with open(r'C:\Users\Administrator\Desktop\book.txt','w',encoding='utf-8')as file1:
file1.write(sr)
\ 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