Commit 14bc10d4 by BellCodeEditor

save project

parent f482e663
Showing with 5 additions and 2 deletions
with open(r'c:\Users\EDY\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as file:
a=file.readlines()
qwe=[]
for i in a:
x=i.split()
e=0
for w in x[1:]:
e=e+int(w)
qw=x[0]+str(e)
print(qw)
qw=x[0]+str(e)+'\n'
qwe.append(qw)
with open(r'c:\Users\EDY\Documents\lesson13-1\q.txt','a',encoding='utf-8')as file:
file.writelines(qwe)
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