Commit e9a5f3bd by BellCodeEditor

auto save

parent 21cb7a20
Showing with 6 additions and 6 deletions
with open(r'c:\Users\EDZ\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8')as files:
a=files.readlines()
sun=[]
list=[]
for i in a:
#print(i)
date=i.split()
......@@ -9,12 +9,12 @@ for i in a:
sum=0
for sale in date[1:]:
sum+=int(sale)
result=date[0]+str(sum)+'\n'
result=date[0]+str(sum)+"\n"
list.append(result)
print(result)
sun.append(result)
print(result)
with open(r'C:\Users\EDZ\Desktop\test','a',encoding='utf-8')as files:
files.writelines(sun)
with open(r'"C:\Users\EDZ\Desktop\test.txt"','a',encoding='utf-8')as files:
files.writelines(list)
......
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