Commit c2c4dcc5 by BellCodeEditor

save project

parent 96b961f7
Showing with 8 additions and 3 deletions
...@@ -2,12 +2,18 @@ ...@@ -2,12 +2,18 @@
# with open("C:\\Users\\栩栩\\Desktop\\a.text","a",encoding="utf-8")as file: # with open("C:\\Users\\栩栩\\Desktop\\a.text","a",encoding="utf-8")as file:
# file.write('小强:12本\n') # file.write('小强:10本\n')
# file.write('李明:15本\n') # file.write('李明:15本\n')
# file.write('小兰:9本\n') # file.write('小兰:9本\n')
new=""
file1=open("C:\\Users\\栩栩\\Desktop\\a.text","r",encoding="utf-8") file1=open("C:\\Users\\栩栩\\Desktop\\a.text","r",encoding="utf-8")
for i in file1: for i in file1:
if '小强' in i: if '小强' in i:
print("在") print("在")
i.replace('10','11')
if '小兰' in i: if '小兰' in i:
print("在") print("在")
\ No newline at end of file i.replace('9','12')
new=new+i
with open("C:\\Users\\栩栩\\Desktop\\a.text","w",encoding="utf-8")as file:
file.white(new)
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