Commit f15e5f03 by BellCodeEditor

save project

parent 38f08981
Showing with 27 additions and 0 deletions
fn = []
with open(r"c:\Users\admin\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as a:
a=a.readlines()
for i in a:
i=i.split()
s=0
for j in i[1:]:
j = int(j)
s += j
res = i[0] + str(s) + "\n"
fn.append(res)
with open(r"c:\Users\admin\Documents\lesson13-1\y.txt","w",encoding="utf-8") as a:
a.writelines(fn)
\ No newline at end of file
悟空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