Commit ec9de5eb by BellCodeEditor

save project

parent def27518
Showing with 5 additions and 6 deletions
...@@ -2,12 +2,11 @@ with open('sales_list.txt','r',encoding='utf-8') as f: ...@@ -2,12 +2,11 @@ with open('sales_list.txt','r',encoding='utf-8') as f:
file=f.readlines() file=f.readlines()
for i in file: for i in file:
date=i.split() date=i.split()
print(date[0]) sum=0
for j in date[1:]:
sum=sum+int(j)
s=date[0]+str(sum)
print(s)
......
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