Commit 3c464cba by BellCodeEditor

auto save

parent 753d8b00
Showing with 15 additions and 0 deletions
with open(r'c:\Users\chenming\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as w:
list=[]
q=w.readlines()
# print(q)
for i in q:
a=i.split()
e=0
for r in a[1:]:
e+=int(r)
name=q[0]+' '+str(e)+'\n'
print(name)
list.append(name)
with open(r'c:\Users\chenming\Documents\lesson13-1\sales_list.txt1','a',encoding='utf-8')as m:
m.write(e)
\ 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