Commit 718dcb9b by BellCodeEditor

save project

parent 753f7b50
Showing with 6 additions and 5 deletions
filel=open(r'C:\Users\Think\Desktop\新建文件夹\新建文本文档.txt','a',encoding='utf-8')
filel.write('小丽:ll本\n')
filel.write('小名:l5本\n')
filel.close()
with open(r'C:\Users\Think\Desktop\新建文件夹\新建文本文档.txt','a',encoding='utf-8') as file:
for data in filel:
if '小强: 10本' in data:
print('小强数据在文件中')
if '小名: 15本' in data:
print('小名数据在文件中')
......
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