Commit 413ee99d by BellCodeEditor

save project

parent ef5115bb
Showing with 8 additions and 2 deletions
...@@ -17,9 +17,9 @@ list.close() ...@@ -17,9 +17,9 @@ list.close()
list = open(r"c:\Users\EDZ\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8') list = open(r"c:\Users\EDZ\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8')
file_list=[]
b=0 b=0
a = list.readlines() a = list.readlines()
print(a)
for i in a: for i in a:
c=0 c=0
data = i.split() data = i.split()
...@@ -29,6 +29,11 @@ for i in a: ...@@ -29,6 +29,11 @@ for i in a:
b = int(j) b = int(j)
c = c + b c = c + b
c = str(c) c = str(c)
print(name + c) d = name + c + "\n"
file_list.append(d)
list.close()
list = open(r"c:\Users\EDZ\Documents\lesson13-1\sales_list.txt",'w',encoding='utf-8')
list.writelines(file_list)
list.close() list.close()
\ 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