Commit 0f8fd56c by BellCodeEditor

auto save

parent bea938a6
Showing with 0 additions and 14 deletions
with open( r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as file:
a=file.readlines()
boo=[]
for i in a:
d=i.split()
sum=0
for salas in d[1: ]:
sum+=int(salas)
l=d[0] +str(sum)
boo.append(l)
print(l)
with open( r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','w',encoding='utf-8')as file:
file.writelines(boo)
\ 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