Commit 92bbd0a3 by BellCodeEditor

save project

parent d1536a55
Showing with 29 additions and 0 deletions
with open(r"C:\Users\aki\Desktop\sales_list.txt","r",encoding="utf-8") as file1:
a = file1.readlines()
result_list = []
for i in a:
data = i.split()
name = data[0]
number = data[1:]
sum = 0
for money in number:
sum += int(money)
result = sum
result_list.append(data[0] + str(result) +"\n")
with open("sales_list.txt",'w',encoding='utf-8') as file1:
file1.writelines(result_list)
\ 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