Commit 3f21da10 by BellCodeEditor

save project

parent 65822c0b
Showing with 6 additions and 1 deletions
with open("sales_list.txt","r",encoding="utf-8")as file:
f=file.readlines()
for i in f:
print(i,end=" ")
data=i.split(" ")
sum=0
for num in data[1:]:
if num not in ["\n"," ",""]:
sum += int(num)
print(data[0] + str(sum))
file.close()
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