Commit 4156682e by BellCodeEditor

save project

parent 9b96e76f
Showing with 5 additions and 11 deletions
with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding = 'utf-8') as i: with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding = 'utf-8') as i:
L = i.readlines() L = i.readlines()
print(L) rint(L)
print((type(L[3:5]))) pripnt((type(L[3:5])))
for j in L: for i in L
sum = 0
s = j.split() \ No newline at end of file
print(s[0])
#print(s[1:])
for k in s[1:]:
sum=sum+int(k)
print(s[0],sum)
\ 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