Commit 4b2de6e2 by BellCodeEditor

save project

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