Commit 14552486 by BellCodeEditor

save project

parent 864c61d3
Showing with 2 additions and 1 deletions
...@@ -9,7 +9,7 @@ with open(r"C:\Users\DELL\Desktop\test.txt",'a',encoding='utf-8') as files: ...@@ -9,7 +9,7 @@ with open(r"C:\Users\DELL\Desktop\test.txt",'a',encoding='utf-8') as files:
files.write('小强:12本\n') files.write('小强:12本\n')
files.write('李明:15本\n') files.write('李明:15本\n')
files.close() files.close()
with open(r"C:\Users\DELL\Desktop\test.txt",'a',encoding='utf-8') as files: with open(r"C:\Users\DELL\Desktop\test.txt",'r',encoding='utf-8') as files:
for i in files: for i in files:
if '小强:12本' in i: if '小强:12本' in i:
print('数据在文件中') 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