Commit 7aa83755 by BellCodeEditor

save project

parent c762b884
Showing with 5 additions and 2 deletions
...@@ -4,4 +4,8 @@ x.write('小兰:12本\n') ...@@ -4,4 +4,8 @@ x.write('小兰:12本\n')
x.write('小丽:11本\n') x.write('小丽:11本\n')
x.write('李文:9本\n') x.write('李文:9本\n')
x.write('张伟:16本\n') x.write('张伟:16本\n')
x.close() x.close()
\ No newline at end of file with open('C:\\Users\\Administrator\\Desktop\\text.txt','r',encoding='utf-8') as x:
for data in x:
if '小兰:12本' in data:
print("yes")
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