Commit 339923b6 by BellCodeEditor

auto save

parent 462a1ac6
Showing with 20 additions and 5 deletions
for i in range(1,1000): # 行
for j in range(1,i+1): # 列
print(i,"x",j,"=",(j*i),end=" ")
print()
\ No newline at end of file
# fliel=open(r'C:\Users\mayi\Desktop\test.txt','a',encoding='utf_8')
# fliel.write('小兰:12本\n')
# fliel.write('小丽:11本\n')
# fliel.write('李文:9本\n')
# fliel.write('张伟:15本\n')
# fliel.close()
# with open(r'C:\Users\mayi\Desktop\test.txt','a',encoding='utf_8') as fliel:
# fliel.write('maobo:50')
with open(r'C:\Users\mayi\Desktop\test.txt','r',encoding='utf_8') as fliel:
new_data=''
for data in fliel:
if '小丽:11本' in data:
data=data.replace('小丽:11本','小丽:15本')
new_data+=data
print(new_data)
with open(r'C:\Users\mayi\Desktop\test.txt','w',encoding='utf_8') as fliel:
fliel.write(new_data)
\ 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