Commit ca864d2f by BellCodeEditor

save project

parent d1536a55
Showing with 11 additions and 0 deletions
xin_liebiao=[]
with open(r'c:\Users\admin\Desktop\sales_list.txt.txt','r',encoding='utf-8') as fill:
a=fill.readlines()
for i in a:
new_a=i.split()
qian=0
for b in new_a[1:]:
qian=qian+int(b)
xin_liebiao.append(new_a[0]+str(qian)+'/n')
with open(r'c:\Users\admin\Desktop\a.txt','w',encoding='utf-8') as d:
d.writelines(xin_liebiao)
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