Commit 196fa712 by BellCodeEditor

save project

parent ee970f14
Showing with 7 additions and 4 deletions
...@@ -4,12 +4,15 @@ ...@@ -4,12 +4,15 @@
# wert.write('李文:9本\n') # wert.write('李文:9本\n')
# wert.write('张伟:16本\n') # wert.write('张伟:16本\n')
# wert.close() # wert.close()
q=''
with open(r'C:\Users\Administrator\Desktop\test13.txt','r',encoding='utf-8')as wert: with open(r'C:\Users\Administrator\Desktop\test13.txt','r',encoding='utf-8')as wert:
for i in wert: for i in wert:
if "小兰" in i: # if "小兰:12本" in i:
print("找到了!") i.replace("小兰:12本","小兰:14本")
if '小强:10本' in i: # if '小强:10本' in i:
print("找到了!") i.replace('小强:10本','小强:11本')
q+=i
print(i)
# wert: # wert:
# wert.write("小兰:12本\n") # wert.write("小兰:12本\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