Commit 0f23017d by BellCodeEditor

save project

parent e1353262
Showing with 6 additions and 2 deletions
...@@ -9,4 +9,9 @@ filel.close() ...@@ -9,4 +9,9 @@ filel.close()
with open(r"C:\罗凯升\test.txt","a",encoding="utf-8")as filel: with open(r"C:\罗凯升\test.txt","a",encoding="utf-8")as filel:
filel.write('小强:10本\n') filel.write('小强:10本\n')
filel.write('李明:15本\n') filel.write('李明:15本\n')
filel.close() filel.close()
\ No newline at end of file
with open(r"C:\罗凯升\test.txt","r",encoding="utf-8")as filel:
for data in filel:
if "小强:10本" in data:
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