Commit 0d0c4fbc by BellCodeEditor

save project

parent 619776c7
Showing with 20 additions and 1 deletions
final_list=[]
with open("sales_list.txt","r",encoding="utf-8") as file:
f = file.readlines()
for i in f:
......@@ -6,5 +7,9 @@ with open("sales_list.txt","r",encoding="utf-8") as file:
for num in data[1:]:
if num not in {'\n',' ',''}:
sum += int(num)
print(data[0] + str(sum))
final_list.append(data[0] + str(sum) + '\n')
file.close()
with open("sum_list.txt","w",encoding="utf-8") as file2:
file2.writelines(final_list)
file2.close()
\ 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