Commit d80bbffd by BellCodeEditor

save project

parent ec9de5eb
Showing with 18 additions and 3 deletions
悟空348
诺依380
小贝182
李丽201
宋扬107
王明245
李强164
孙小白222
苏琪137
刘若若147
刘阳226
王胜男123
王娇131
with open('sales_list.txt','r',encoding='utf-8') as f: with open('sales_list.txt','r',encoding='utf-8') as f:
file=f.readlines() file=f.readlines()
list=[]
for i in file: for i in file:
date=i.split() date=i.split()
sum=0 sum=0
for j in date[1:]: for j in date[1:]:
sum=sum+int(j) sum=sum+int(j)
s=date[0]+str(sum) s=date[0]+str(sum)+'\n'
print(s) list.append(s)
with open('a.txt','w',encoding='utf-8') as f1:
f1.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