Commit 02b00bf0 by BellCodeEditor

save project

parent 73008f5e
Showing with 5 additions and 2 deletions
with open(r"c:\Users\Administrator\Documents\lesson13_2\sales_list.txt","r",encoding="utf-8") as b:
a=b.readlines()
list=[]
for i in a:
c=i.split()
d=0
for i in c[1:]:
d=d+int(i)
e=c[0]+str(d)
print(e)
e=c[0]+str(d)+"\n"
list.append(e)
with open(r"c:\Users\Administrator\Documents\lesson13_2\sales_list.txt","w",encoding="utf-8") as b:
b.writelines(list)
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