Commit 2391a2e1 by BellCodeEditor

save project

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