Commit 4f442c68 by BellCodeEditor

auto save

parent f44c31ce
Showing with 5 additions and 3 deletions
...@@ -7,9 +7,10 @@ for i in a: ...@@ -7,9 +7,10 @@ for i in a:
sum=0 sum=0
for sales in data[1:]: for sales in data[1:]:
sum=sum+int(sales) sum=sum+int(sales)
b=data[0]+str(sum)+"/n" b=data[0]+str(sum)+'\n'
c=append(d) c.append(b)
writelines(c) with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8') as file:
file.writelines(c)
\ 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