Commit 26ee4542 by BellCodeEditor

save project

parent f3326d95
Showing with 2 additions and 16 deletions
with open(r"c:\Users\Lenovo\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file: open( r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r')
a=file.readlines() \ No newline at end of file
g=[]
for i in a:
la=i.split()
p=0
for l in la[1:]:
p=p+int(l)
k=la[0]+str(p)
#print(k)
g.append(k)
with open(r"c:\Users\Lenovo\Documents\lesson13-1\sales_list.txt","a",encoding="utf-8") as file:
file.writelines(g)
\ 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