Commit 6f0b39a9 by BellCodeEditor

save project

parent 54df7f6e
Showing with 7 additions and 1 deletions
with open(r'c:\Users\Windows 7\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8')as file:
a=file.readlines()
#print(a)
for i in a:
c=i.split()
print(c[1:])
#print(c[1:])
sum=0
for sales in c[1:]:
sum=sum+int(sales)
b=c[0] +":"+ str(sum)
print(b)
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