Commit 0c04b04b by BellCodeEditor

auto save

parent 13e201ae
Showing with 5 additions and 4 deletions
with open(r'c:\Users\karlcarlo\Documents\lesson13-1\sales_list.txt ','r',encoding='utf-8')as files:
a=files.readlines()
#print
finally_sum=[]
for i in a:
result=i.split()
sum=0
for sale in result[1:]:
sum=sum+int(sale)
count=result[0]+str(sum)
print(count)
count=result[0]+str(sum)+'/n'
finally_sum.appand(count)
\ 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