Commit 10e67852 by BellCodeEditor

save project

parent eca3d243
Showing with 4 additions and 2 deletions
with open(r'c:\Users\makcoo\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as q: with open(r'c:\Users\makcoo\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as q:
a=q.readlines() a=q.readlines()
x=0 x=0
qaz=[]
for i in a: for i in a:
z=i.split() z=i.split()
for s in z[1:]: for s in z[1:]:
x+=int(s) x+=int(s)
o=z[0]+str(x) o=z[0]+str(x)
print(o) qaz.append(o)
with open(r'c:\Users\makcoo\Documents\lesson13-1\sales_list.txt','a',encoding='utf=8') as ijn:
ijn.writelines(qaz)
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