Commit 83fc1149 by BellCodeEditor

save project

parent c72495d7
Showing with 12 additions and 4 deletions
......@@ -6,9 +6,17 @@
#q.write('小丽:11本\n')
#q.write('李文:9本\n')
#q.write('张伟:16本\n')
#q.write('小强:16本\n')
#q.write('小强:10本\n')
#q.write('李明:16本\n')
#q.close()
d=''
with open('C:\\Users\\User\\Desktop\\book.txt','r',encoding='UTF-8')as q:
w=q.read()
print(w)
\ No newline at end of file
#w=q.read()
#print(w)
for w in q:
if '小强:16本' in w:
print('abababab')
d=w.replace('小强:10本','小强:11本')
d+=w
print(d)
\ 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