Commit d37b05b9 by BellCodeEditor

save project

parent 440baa5d
Showing with 13 additions and 2 deletions
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
# a.close() # a.close()
with open(r"C:\Users\EDZ\Desktop\text.txt",'r',encoding='UTF-8') as a: with open(r"C:\Users\EDZ\Desktop\text.txt",'r',encoding='UTF-8') as a:
for i in a: for i in a:
if "小明" in file: if "小强:12本" in i:
print("在") print("在")
else:
print("不在")
if "小兰:12本" in i:
print("在")
else:
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