Commit ed9362c9 by BellCodeEditor

save project

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