Commit af33d0e4 by BellCodeEditor

save project

parent 69fca0c8
Showing with 13 additions and 13 deletions
with open(r'/Users/zll/Desktop/sales_list.txt','r',encoding='utf-8') as f: with open(r'/Users/zll/Desktop/sale_list.txt','r',encoding='utf-8') as f:
a=f.readlines() a=f.readlines()
zz=[]
zz=[] for i in a:
for i in a: aa=i.split()
aa=i.split() sum=0
sum=0 for x in aa[1:]:
for x in aa[1:]: sum=sum+int(x)
sum=sum+int(x) qq=aa[0]+str(sum)
qq=aa[0]+str(sum) zz.append(qq)
zz.append(qq) print(zz)
print(zz) with open(r'/Users/zll/Desktop/sale_list.txt','a',encoding='utf-8') as f:
f.write(zz)
\ No newline at end of file \ 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