Commit 8c37dc4d by BellCodeEditor

save project

parent 234cfb12
Showing with 8 additions and 1 deletions
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8') as f: with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8') as f:
for i in f: for i in f:
sum=0
a=i.split() a=i.split()
print(a[0],a[1:]) for b in a[1:]:
c=int(b)
sum+=c
d=a[0]+':'+str(sum))
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