Commit 20884dc2 by BellCodeEditor

save project

parent 5376c6de
Showing with 7 additions and 2 deletions
...@@ -6,5 +6,10 @@ ...@@ -6,5 +6,10 @@
with open(r"c:\Users\Administrator\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file: with open(r"c:\Users\Administrator\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file:
txt1=file.readlines() txt1=file.readlines()
for i in txt1: for i in txt1:
list1=i.split() sum=0
print(list1[1:]) listi=i.split()
for j in listi[1:]:
sum+=int(j)
result=listi[0]+str(sum)
print(result)
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