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