Commit e2fe5e91 by BellCodeEditor

save project

parent bb1fb2be
Showing with 10 additions and 2 deletions
...@@ -9,4 +9,13 @@ ...@@ -9,4 +9,13 @@
# with open(r'C:\Users\Lenovo\Desktop\book.txt',"a",encoding="utf-8") as file: # with open(r'C:\Users\Lenovo\Desktop\book.txt',"a",encoding="utf-8") as file:
# file.write('小兰:12本、小丽:11本、李文:9本、张伟:16本') # file.write('小兰:12本、小丽:11本、李文:9本、张伟:16本')
with open(r'C:\Users\Lenovo\Desktop\book.txt',"r",encoding="utf-8") as file: with open(r'C:\Users\Lenovo\Desktop\book.txt',"r",encoding="utf-8") as file:
file.write('小兰:12本、小丽:11本、李文:9本、张伟:16本') for i in file.read():
\ No newline at end of file print(i)
if "小强:10本" in i:
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