Commit 900b49f7 by BellCodeEditor

auto save

parent 86958793
Showing with 9 additions and 12 deletions
with open("C:\\Users\\1\\Desktop\\sales_list.txt",'r',encoding='utf-8') as file: import turtle as t
a=file.readlines() t.goto(0,100)
final_sum=[] t.forward(100)
for i in a: t.left(120)
b=i.split() t.forward(100)
sum=0 t.right(60)
for sales in b[1:]: t.backward(10)
d=sum+int(sales) t.reset()
t=b[0]+str(d)+'\n' t.done()
final_sum.append(t)
with open('C:\\Users\\1\\Desktop\\test.txt','w',encoding='utf-8') as file:
file.writelines(final_sum)
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