Commit b7dd75fe by BellCodeEditor

save project

parent 991cf276
Showing with 6 additions and 2 deletions
new_data=''
with.open(r'C:\Uusers\CM\Desktop\test.txt','w',encoding='utf-8') with.open(r'C:\Uusers\CM\Desktop\test.txt','w',encoding='utf-8')
filel.write('小兰:12本') filel.write('小兰:12本')
filel.close() filel.close()
for data in 123: for data in filel:
if '小强:10本'in data: if '小强:10本'in data:
print() data=data.replace('小强:10本','小强:11本')
new_data +=data
print(new_data)
\ 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