Commit d9dcf7d7 by BellCodeEditor

auto save

parent a23b26cf
Showing with 6 additions and 0 deletions
with open(r'C:\Users\学生账户\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file1:
a=file1.readlines()
#print(a)
file_sum=[]
for i in a:
new_data=i.split()
#print(new_data[1:])
......@@ -8,5 +9,9 @@ for i in a:
for sales in new_data[1:]:
sum=sum+int(sales)
result=new_data[0]+str(sum)
print(result)
with open(r'C:\Users\学生账户\Documents\lesson13-1\sales_list.txt','w',encoding='utf-8')as file2:
\ 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