Commit 3a637162 by BellCodeEditor

save project

parent ed9362c9
Showing with 16 additions and 9 deletions
......@@ -5,13 +5,20 @@
# sss.close()
# with open(r'C:\Users\Administrator\Desktop\text.txt','a',encoding='utf-8')as sss:
# sss.write('小强:12本\n李明:15本\n')
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
# sss=open(r'C:\Users\Administrator\Desktop\text.txt','r',encoding='utf-8')
# a=sss.read()
# if '小强:12本'in a:
# print("有")
# if '小兰:12本'in a:
# print("有")
# sss.close()
with open(r'C:\Users\Administrator\Desktop\text.txt','a',encoding='utf-8')as sss:
for a in sss
if '小强:12本'in a:
a=a.str.replace('小强:12','小强:11')
for a in sss
if '小兰:12本'in a:
a=a.str.replace('小兰:12','小兰:14')
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