Commit a200a5b8 by BellCodeEditor

save project

parent b507951d
Showing with 19 additions and 2 deletions
with open(r'sales_list.txt','r',encoding='utf-8') as file: with open(r'sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines() a=file.readlines()
list1=[]
for i in a: for i in a:
date=i.split() date=i.split()
sum=0 sum=0
for q in date[1:]: for q in date[1:]:
sum+=int(q) sum+=int(q)
print(date[0]+str(sum)) print(date[0]+str(sum))
\ No newline at end of file list1.append(date[0]+str(sum)+'\n')
with open(r'new_sales_list.txt','w',encoding='utf-8') as file1:
file1.writelines(list1)
\ 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