Commit ee6ff1c1 by BellCodeEditor

save project

parent d3310cc4
Showing with 7 additions and 2 deletions
...@@ -2,4 +2,9 @@ with open(r'c:\Users\EDZ\Documents\lesson13-1\sales_list.txt','r',encoding='UTF- ...@@ -2,4 +2,9 @@ with open(r'c:\Users\EDZ\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-
a=file.readlines() a=file.readlines()
for i in a: for i in a:
dj=i.split() dj=i.split()
print(dj[0],dj[1:]) #print(dj[0],dj[1:])
\ No newline at end of file sum = 0
for e in dj[1:]:
sum = sum+int(e)
result=dj[0]+str(sum)
print(result)
\ No newline at end of file
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