Commit 83d84bfc by BellCodeEditor

save project

parent 8eb30dcf
Showing with 19 additions and 0 deletions
......@@ -8,3 +8,22 @@ file1.close()
with open(r'C:\Users\CM\Desktop\book.txt','w',encoding='utf-8') as file:
file.write('小强:10本\n')
file.write('李明:15本\n')
with open(r'C:\Users\CM\Desktop\book.txt','r',encoding='utf-8') as file1:
for data in file1:
if '小强:10本' in date:
print('小强在文件中')
if '小兰:12本' in date:
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