Commit ec8dd696 by BellCodeEditor

save project

parent ebf4d3ed
Showing with 3 additions and 13 deletions
with open(r'c:\Users\Thinkpad\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as a: filei=open(r'C:\Users\Thinkpad\Desktop\zeng.txt','w',encoding='utf-8')
b=a.readlines() filei.write('rycgsjgdh')
dog=[] \ No newline at end of file
for i in b:
s=0
c=i.split()
for j in c[1:]:
s+=int(j)
txt=c[0]+str(s)+'\n'
dog.append(txt)
with open(r'c:\Users\Thinkpad\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8') as a:
a.writelines(dog)
\ 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