Commit 98bed651 by BellCodeEditor

save project

parent b504cd30
Showing with 4 additions and 1 deletions
...@@ -3,5 +3,7 @@ ...@@ -3,5 +3,7 @@
#file1.write('小兰:12本','小丽:11本','李文:11本','张伟:11本') #file1.write('小兰:12本','小丽:11本','李文:11本','张伟:11本')
#file1.close() #file1.close()
with open(r'C:\\Users\\Administrator\\Desktop\\test.txt','w',encoding='utf-8')as file: with open(r'C:\\Users\\Administrator\\Desktop\\test.txt','w',encoding='utf-8')as file:
file.write('小兰:12本') for data in file:
if '小强:10' in 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