Commit 599f4530 by BellCodeEditor

save project

parent 7b63badb
Showing with 39 additions and 5 deletions
c = 0
with open(r'C:\Users\Administrator\Documents\lesson13_2\sales_list.txt','r',encoding = 'utf-8') as file:
a = file.readlines()
for i in a:
d = []
for i in a:
b = i.split()
c = 0
for n in b[1:]:
c += int(n)
print( b[0] , c )
e = b[0]+str(c)+'\n'
c = 0
d.append(e)
with open(r'C:\Users\Administrator\Documents\lesson13_2\j.txt','a',encoding='utf-8')as file:
file.writelines(d)
\ No newline at end of file
悟空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