Commit 7dbdb414 by BellCodeEditor

save project

parent 6ce9c3b7
Showing with 3 additions and 2 deletions
with open(r"c:\Users\蔡沛希\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8")as a: with open(r"c:\Users\蔡沛希\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8")as a:
d=a.readlines() d=a.readlines()
l = []
for i in d: for i in d:
date=i.split() date=i.split()
sum = 0 sum = 0
for j in date[1:]: for j in date[1:]:
sum += int(j) sum += int(j)
b=date[0] + str(sum) b=date[0] + str(sum) + "\n"
print(b) l.append(b)
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