Commit ede4e4c4 by BellCodeEditor

save project

parent e3ce839f
Showing with 5 additions and 7 deletions
......@@ -5,5 +5,7 @@ with open (r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',enc
sum=0
for sales in data [1:]:
sum=sum+int(sales)
result=data[0]+str(sum)
print(result)
\ No newline at end of file
result=data[0]+str(sum)+'\n'
with open (r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','w',encoding='utf-8') as file1:
file1.writelines(result)
悟空 12 12 11
诺伊 45 67 37
小贝 23 34 56
\ No newline at end of file
诺伊320
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