Commit 5c3c11b6 by BellCodeEditor

save project

parent 0ac35733
Showing with 4 additions and 2 deletions
with open(r"c:\Users\xmbc\Documents\lesson13-1\sales_list.txt","r",encoding='utf-8') as q: with open(r"c:\Users\xmbc\Documents\lesson13-1\sales_list.txt","r",encoding='utf-8') as q:
w=q.readlines() w=q.readlines()
g=[]
for i in w: for i in w:
e=i.split() e=i.split()
#print(e[0]) #print(e[0])
...@@ -7,4 +8,6 @@ for i in w: ...@@ -7,4 +8,6 @@ for i in w:
z=0 z=0
for a in e[1:]: for a in e[1:]:
z+=int(a) z+=int(a)
print(e[0]+str(z)) b=e[0]+str(z)+"\n"
\ No newline at end of file g.append(b)
print(e[0]+str(z))
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