Commit ca92c694 by BellCodeEditor

auto save

parent 2f899819
Showing with 13 additions and 2 deletions
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
print(file.read())
\ No newline at end of file
a=file.readlines()
# b = a[0]
# print(b[])
# print(type(a[3:5]))
for i in a:
i1=i.split()
# print(i1)
# print(i1[0])
a=0
for i2 in i1[1:]:
a=a+int(i2)
print(i1[0],a,end="\n")
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