Commit dd11c15e by BellCodeEditor

save project

parent eda384bb
Showing with 4 additions and 4 deletions
......@@ -2,7 +2,7 @@ with open(r'c:\Users\XMBC\Documents\lesson13-1\sales_list.txt','r',encoding='utf
a=file.readlines()
#print(a)
l=0
l=[]
for i in a:
new_i=i.split()
#print(new_i[1:])
......@@ -11,5 +11,5 @@ for i in a:
sun=sun+int(sales)
s=new_i[0]+str(sun)+'\n'
l.append(s)
with open(r'c:\Users\XMBC\Desktop\新建文本文档.txt','r',encoding='utf-8') as file:
file.writelines(final_)
\ No newline at end of file
with open(r'c:\Users\XMBC\Desktop\新建文本文档.txt','a',encoding='utf-8') as file:
file.writelines(l)
\ 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