Commit 7d8881b3 by BellCodeEditor

save project

parent 41433086
Showing with 3 additions and 3 deletions
...@@ -8,5 +8,6 @@ ...@@ -8,5 +8,6 @@
# '李明:8本\n') # '李明:8本\n')
#file1.close() #file1.close()
with open(r"D:\Desktop\book.txt","r",encoding='utf-8') as file1: with open(r"D:\Desktop\book.txt","r",encoding='utf-8') as file1:
a=file1.read() for a in file1:
print(a) if '小强:12本' in a:
\ No newline at end of file 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