From 022a1805d7544476e2162a62c6d63d2df449f646 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 30 Jan 2021 13:18:43 +0800 Subject: [PATCH] save project --- diy.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/diy.py b/diy.py index a2ebeb3..a443274 100644 --- a/diy.py +++ b/diy.py @@ -1,6 +1,9 @@ with open(r'C:\Users\EDZ\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8')as file: a=file.readlines() -for i in a : - data=i.split() - print(data[1:]) + sum=0 + for i in a : + data=i.split() + for sales in data[1:]: + sum=sum+int(data) + print(sum) \ No newline at end of file -- libgit2 0.25.0