Commit 9ab4990d by BellCodeEditor

auto save

parent 52670733
Showing with 5 additions and 2 deletions
with open(r'c:\Users\EDZ\Documents\lesson13-4\sales_list.txt','r',encoding='utf-8')as files:
a=files.readlines()
lise=[]
for i in a:
#print(i)
date=i.split()
......@@ -8,9 +9,11 @@ for i in a:
sum=0
for sale in date[1:]:
sum+=int(sale)
result=date[0]+str(sum)
result=date[0]+str(sum)+"\n"
lise.append(result)
print(result)
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