Commit 962a14af by BellCodeEditor

save project

parent d1536a55
Showing with 13 additions and 0 deletions
with open("sales_list.txt","r",encoding='utf-8') as file1:
a=file1.readlines()
c=[]
for i in a:
i=i.split()
b=0
for sale in i[1:]:
b+=int(sale)
d =i[0]+str(b)+"\n"
c.append(d)
with open("happy.txt","w",encoding='utf-8') as file1:
file1.writelines(c)
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