Commit ec3fd9da by BellCodeEditor

auto save

parent 8968ded9
Showing with 9 additions and 3 deletions
with open(r'C:\Users\Lenovo\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines()
#print(a)
for i in a :
b=i.split()
print(b[1:])
for i in a:
b=i.split()
#print(b[1:])
sum = 0
for c in b[1:]:
# print(c)
sum +=int(c)
d = b[0]+str(sum)
print(d)
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