Commit 45e485cb by BellCodeEditor

save project

parent a20ec339
Showing with 6 additions and 1 deletions
with open (r"C:\Users\win10\Documents\lesson13-1\sales_list.txt","r",encoding='UTF-8') as file: with open (r"C:\Users\win10\Documents\lesson13-1\sales_list.txt","r",encoding='UTF-8') as file:
a=file.readlines() a=file.readlines()
po=[]
for i in a: for i in a:
u=0 u=0
p=i.split() p=i.split()
for o in p[1: ]: for o in p[1: ]:
u=u+int(o) u=u+int(o)
print(p[0]+str(u)) e=p[0]+str(u)+'\n'
po.append(e)
with open (r"C:\Users\win10\Documents\lesson13-1\new_sales_list.txt","w",encoding='UTF-8') as file:
file.writelines(po)
\ 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