Commit e929f930 by BellCodeEditor

save project

parent 5ec53ebb
Showing with 15 additions and 0 deletions
with open(r"C:\Users\Administrator\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8')as file:
a=file.readlines()
print(a)
sbf_fist=[]
for i in a:
date=i.split()
#print(date[1:])
sum=0
for sales in date[1:]:
sum=sum+int(sales)
valesu=date[0]+" "+str(sum)+"\n"
sum_list.append(valesu)
with open(r'C:\Users\Administrator\Desktop\text.txt',"w",encoding="utf-8")as sbe:
sbe.writelines(sum_list)
\ 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