Commit b06d004d by BellCodeEditor

save project

parent fc6ecb71
Showing with 7 additions and 2 deletions
with open(r'c:\Users\客家话吧\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as pop:
a=pop.readlines()
for i in a :
sum=0
popme = i.split()
print(popme[1:])
\ No newline at end of file
for x in popme[1:]:
sum+=int(x)
print(popme[0]+':'+str(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