Commit f53442c3 by BellCodeEditor

save project

parent e02c1c6f
Showing with 12 additions and 3 deletions
......@@ -8,8 +8,17 @@ with open(r"C:\Users\Administrator\Desktop","a",encoding='utf-8') as file:
file.write()
file.write('小强:12本/n')
file.write('李明:15本/n')
new_data=''
open(r"C:\Users\Administrator\Desktop","r",encoding='utf-8') as file
for i in file:
if '小兰:12本' in i:
print("数据在小兰里面")
for data in file:
if '小强:12本' in data:
data=data.replace('小强:12本','小强:11本')
new_data +=data
print(new_data)
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