Commit 1df2bfb8 by BellCodeEditor

save project

parent c7feb910
Showing with 8 additions and 2 deletions
g=0 g=0
v=""
with open(r'c:\Users\EDZ\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as a: with open(r'c:\Users\EDZ\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as a:
for i in a.readlines(): for i in a.readlines():
i=i.split() i=i.split()
print(i[0],end=': ') print(i[0],end=': ')
v+=str(i[0])+': '
s=0 s=0
for j in i[1:]: for j in i[1:]:
s += int(j) s += int(j)
print(s) print(s)
v+=str(s)+'\n'
g+=s g+=s
print(g) print(g)
\ No newline at end of file v+=str(g)+'\n'
with open(r'c:\Users\EDZ\Documents\lesson13-1\ales_list.txt','w',encoding='utf-8') as f:
f.write(v)
\ 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