Commit 09c5e5ce by BellCodeEditor

save project

parent de14d4fd
Showing with 8 additions and 4 deletions
with open(r'C:\Users\于景波\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as file: with open(r'C:\Users\于景波\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as file:
a=file.readlines() a=file.readlines()
for i in a: for i in a:
realeavor=i.split() realeavor=i.split()
print(realeavor[1:]) sum=0
\ No newline at end of file for s in realeavor[1:]:
sum=sum+int(s)
result=realeavor[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