Commit 12403227 by BellCodeEditor

save project

parent ba23a623
Showing with 3 additions and 1 deletions
with open(r"c:\Users\Asus\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file_1:
a = file_1.readlines()
final_list = []
for i in a:
date = i.split()
#print(date[0])
......@@ -8,7 +10,7 @@ for i in a:
sum1 = 0
for sales in date[1:]:
sum1 = sum1 + int(sales)
result = date[0] + str(sum1)
result = date[0] + str(sum1)+'\n'
final_list.append(result)
with open(r"c:\Users\Asus\Documents\lesson13-1\sales_list.txt","a",encoding="utf-8") as file_1:
......
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