Commit 3d5a6937 by BellCodeEditor

save project

parent 8bc393fd
Showing with 2 additions and 1 deletions
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:
a=file.readlines() a=file.readlines()
#print(a) #print(a)
list=[]
for j in a: for j in a:
sum=0 sum=0
#print(j) #print(j)
...@@ -8,5 +9,5 @@ for j in a: ...@@ -8,5 +9,5 @@ for j in a:
#print(y[1:]) #print(y[1:])
for i in y[1:]: for i in y[1:]:
sum+=int(i) sum+=int(i)
l=y[0]+str(sum) l=y[0]+str(sum)+'\n'
print(l) print(l)
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