Commit 5243bb4e by BellCodeEditor

save project

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