Commit e497cf87 by BellCodeEditor

save project

parent 739d5496
Showing with 4 additions and 5 deletions
...@@ -6,8 +6,7 @@ with open(r"C:\Users\XMBC\Desktop\a.txt","a",encoding="utf-8") as a: ...@@ -6,8 +6,7 @@ with open(r"C:\Users\XMBC\Desktop\a.txt","a",encoding="utf-8") as a:
a.write("小兰:12本\n") a.write("小兰:12本\n")
with open(r"C:\Users\XMBC\Desktop\a.txt","r",encoding="utf-8") as a: with open(r"C:\Users\XMBC\Desktop\a.txt","r",encoding="utf-8") as a:
for b in a: for b in a:
if "李明:15本" in a: if "李明:15本" in b:
print("找到了") print("找到了")
for b in a: if "小强:10本" in b:
if "小强:10本" in a: print("找到了")
print("找到了") \ No newline at end of file
\ 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