Commit 7c0dac0f by BellCodeEditor

save project

parent 1d6d7e83
Showing with 31 additions and 2 deletions
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8') as f:
e=''
for i in f:
sum=0
a=i.split()
for b in a[1:]:
c=int(b)
sum+=c
d=a[0]+':'+str(sum)
print(d)
d=a[0]+':'+str(sum)+'\n'
e+=d
with open(r'c:\Users\Administrator\Documents\lesson13-4\sum-list.txt','w',encoding='UTF-8') as g:
g.write(e)
......
悟空:348
诺依:380
小贝:182
李丽:201
宋扬:107
王明:245
李强:164
孙小白:222
苏琪:137
刘若若:147
刘阳:226
王胜男:123
王娇:131
悟空:348
诺依:380
小贝:182
李丽:201
宋扬:107
王明:245
李强:164
孙小白:222
苏琪:137
刘若若:147
刘阳:226
王胜男:123
王娇:131
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