Commit 53a31c86 by BellCodeEditor

save project

parent a62089aa
Showing with 6 additions and 2 deletions
new_data=''
with open(r'c:\Users\CM\Desktop\text.txt','r',encoding='utf-8')as flle1: with open(r'c:\Users\CM\Desktop\text.txt','r',encoding='utf-8')as flle1:
for data in flle1: for data in flle1:
if'小强:10本'in data: if'小强:10本'in data:
print() data=str.repalace('小强:10本','小强:11本')
\ No newline at end of file
with open(r'c:\Users\CM\Desktop\text.txt','w',encoding='utf-8')as flle1:
flle1.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