Commit 8bf35e29 by BellCodeEditor

save project

parent 83542b91
Showing with 9 additions and 9 deletions
with open(r"c:\Users\xxd\Desktop\sales_list.txt","r",encoding="utf-8") as file1: with open(r"c:\Users\xxd\Desktop\sales_list.txt","r",encoding="utf-8") as file1:
a=file1.readlines() a=file1.readlines()
for i in a: for i in a:
data=i.split() data=i.split()
#print(data[1:]) #print(data[1:])
sum=0 sum=0
for b in data[1:]: for b in data[1:]:
sum=sum+int(b) sum=sum+int(b)
c=data[0]+str(sum) c=data[0]+str(sum)
print(c) print(c)
\ No newline at end of file \ No newline at end of file
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