Commit 31245573 by BellCodeEditor

save project

parent ff2d50d8
Showing with 13 additions and 3 deletions
f = open('sales_list.txt','r',encoding='utf-8')
a = f.readlines()
for i in a:
d = i.split()
sum=0
for sales in d[1:]:
sum=sum+int(sales)
result=d[0]+str(sum)
print(result)
\ No newline at end of file
...@@ -2,5 +2,5 @@ f = open('sales_list.txt','r',encoding='utf-8') ...@@ -2,5 +2,5 @@ f = open('sales_list.txt','r',encoding='utf-8')
a = f.readlines() a = f.readlines()
for i in a: for i in a:
d = i.split() d = i.split()
sum=0 print(d)
forfddsaaswdwasdwaswdswaswdsawsddgh
\ No newline at end of file \ 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