From b06db795fc972c4f911b0c4192d0781e90cbe6d4 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Fri, 9 Jun 2023 20:06:28 +0800 Subject: [PATCH] save project --- diy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/diy.py b/diy.py index c7517b5..bf8730d 100644 --- a/diy.py +++ b/diy.py @@ -2,4 +2,9 @@ with open(r'C:\Users\windoins\Documents\lesson13-1\sales_list.txt','r',encoding= a = file.readlines() for i in a: data=i.split() - print(data[1:]) \ No newline at end of file + # print(data[1:]) + sum = 0 + for sales in data[1:]: + sum = sum+int(sales) + result=data[0]+str(sum) + print(result) \ No newline at end of file -- libgit2 0.25.0