Commit cd199966 by BellCodeEditor

save project

parent a8d02629
Showing with 17 additions and 0 deletions
file_new = ' '
with open(r"C:\Users\丽达5号\Documents\lesson12-1\vicetone nb.txt",'r',encoding = 'utf-8') as file :
a = file.read()
for data in a:
if '小强:10本' in data :
print('在里面')
data.replace('小绿:10本','小强:11本')
file_new += data
else:
print('没这人,准备后事')
with open(r"C:\Users\丽达5号\Documents\lesson12-1\vicetone nb.txt",'w',encoding = 'utf-8') as file :
file.write(file_new)
\ No newline at end of file
小兰:12本小丽:11本
\ No newline at end of file
小兰:12本小丽:11本
\ 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