Commit 2689f61d by BellCodeEditor

auto save

parent 188f483d
Showing with 12 additions and 2 deletions
with open(r"C:\Users\Administrator\Documents\lesson13-1\sales_list.txt") as file:
\ No newline at end of file
with open(r"C:\Users\Administrator\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8') as file:
a = file.readlines()
fsum=[]
for i in a:
d = i.split()
sum = 0
for j in d[1:]:
sum+=int(j)
r = d[0] + str(sum) + '\n'
fsum.append(r)
\ 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