Commit 772dc45f by BellCodeEditor

save project

parent e9d3caa3
Showing with 3 additions and 3 deletions
...@@ -6,8 +6,7 @@ with open(r"C:\Users\lenovo\Desktop\text.txt",'w',encoding='utf-8') as a: ...@@ -6,8 +6,7 @@ with open(r"C:\Users\lenovo\Desktop\text.txt",'w',encoding='utf-8') as a:
a.write("小强:12本") a.write("小强:12本")
a.write("李民:15本\n") a.write("李民:15本\n")
with open(r"C:\Users\lenovo\Desktop\text.txt",'r',encoding='utf-8') as a: with open(r"C:\Users\lenovo\Desktop\text.txt",'r',encoding='utf-8') as a:
s=a.read() for s in a:
for i in s: if "小强:12本" in s:
if "小强:12本" in i:
print("666") print("666")
\ 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