Commit f1c6bd58 by BellCodeEditor

save project

parent 92f966b7
Showing with 1 additions and 1 deletions
...@@ -9,7 +9,7 @@ new_i='' ...@@ -9,7 +9,7 @@ new_i=''
with open(r"C:\Users\Administrator\Desktop\test.txt",'r',encoding='utf-8')as file: with open(r"C:\Users\Administrator\Desktop\test.txt",'r',encoding='utf-8')as file:
for i in file: for i in file:
if '李明:15本' in i: if '李明:15本' in i:
i.replace('李明:15本','李明:11本') i=i.replace('李明:15本','李明:11本')
new_i+=i new_i+=i
print(new_i) print(new_i)
# file.write('小强:10本\n') # file.write('小强:10本\n')
......
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