Commit 7f146714 by BellCodeEditor

auto save

parent b4c2d08d
Showing with 1 additions and 1 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#file1.write('小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本') #file1.write('小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本')
#file1.close() #file1.close()
file=open(r'C:\Users\Administrator\Desktop\lei.txt','r',encoding='utf-8') file=open(r'C:\Users\Administrator\Desktop\lei.txt','r',encoding='utf-8')
for data in file1: for data in file:
if'小强: 10本'in data: if'小强: 10本'in data:
print('小强数据在文件中') print('小强数据在文件中')
if'小兰: 12本'in data: if'小兰: 12本'in data:
......
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