Commit 87b89d8d by BellCodeEditor

save project

parent 6fa9259b
Showing with 5 additions and 4 deletions
......@@ -2,7 +2,8 @@ with open(r'c:\Users\EDZ\Desktop\sale.list.txt','r',encoding='utf-8') as file:
a=file.readlines()
for i in a:
list=i.split()
total=0
sum=0
for b in list[1:]:
total+=int(b)
print(list[0],total)
\ No newline at end of file
sum+=int(b)
result=list[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