Commit 0f8d97af by BellCodeEditor

save project

parent 4a168315
Showing with 8 additions and 10 deletions
with open("c:\\Users\\86139\\Documents\\lesson13-1\\sales_list.txt",'r',encoding='utf-8') as file: with open("c:\\Users\\86139\\Documents\\lesson13-1\\sales_list.txt",'r',encoding='utf-8') as file:
a=file.readlines() a=file.readlines()
oversum=[] # print(a)
for i in a: for i in a:
data=i.split() ii=i.split()
sum=0 #print(ii[1:])
for sale in data[1:]: ss=0
sum=sum+int(sale) for s in ii[1:]:
new=data[0]+str(sum)+'\n' ss=ss+int(s)
oversum.append() new=ii[0]+str(ss)
with open("c:\\Users\\86139\\Documents\\lesson13-1\\sales_list.txt",'a',encoding='utf-8') as file: print(new)
file.writelines(new)
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