Commit bf9a15c4 by BellCodeEditor

save project

parent fed5ef99
Showing with 7 additions and 2 deletions
...@@ -3,4 +3,10 @@ with open(sb,"r",encoding="utf-8")as file: ...@@ -3,4 +3,10 @@ with open(sb,"r",encoding="utf-8")as file:
list_a=file.readlines() list_a=file.readlines()
for i in list_a: for i in list_a:
data=i.split() data=i.split()
print(data[0:]) sum=0
\ No newline at end of file for sales in data [1:]:
sum=sum+int(sales)
result=data[0]+str(sum)+'\n'
final_sum.append(result)
with open('c:\Users\EDZ\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8')as file:
file.writable(final_sum)
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