Commit ac7b5387 by BellCodeEditor

auto save

parent a2715a9d
Showing with 9 additions and 4 deletions
open(r"c:\Users\xiexiaohua\Documents\lesson13-1\sales_list.txt,"r",encoding="utf-8")
a=file.read()
open(r"c:\Users\xiexiaohua\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file
a=file.readlines()
#print(a)
for i in a:
print(i)
\ No newline at end of file
b=i.split()
sum =0
for sales in b[1:]:
sum=sum+int(sales)
result=b[0]+str(sum)
print(result)
\ 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