Commit 3bbed445 by BellCodeEditor

save project

parent 1445f195
Showing with 662 additions and 4 deletions
new_data=''
with open(r'C:\Users\Administrator\Desktop\新建文件夹\sb.txt','w',encoding='utf-8') as file: with open(r'C:\Users\Administrator\Desktop\新建文件夹\sb.txt','w',encoding='utf-8') as file:
for data in file: for data in file:
if '小兰:10本'in data: if '小兰:10本'in data:
print('数据在文件夹中') data=data.replace('小兰:100本','小兰:10本')
else: new_data+=data
print('数据不在文件夹中')
\ 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