Commit 707f77ef by BellCodeEditor

save project

parent 5a5b8127
Showing with 9 additions and 7 deletions
......@@ -7,12 +7,13 @@ file1=open(r'C:\Users\Administrator\Desktop\cl.txt','r',encoding='utf-8')
#file1.write('小强:12本\n')
#file1.write('李明:15本\n')
a=file1.read()
c=''
print(a)
for i in a:
if '小强:12本' in a:
print('q')
if '李明:15本' in a:
print('w')
break
c+=a.replace('小强:12本','小强:11本')
print(c)
file1.close()
file1=open(r'C:\Users\Administrator\Desktop\cl.txt','w',encoding='utf-8')
file1.write(c)
file1.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