Commit f53bb229 by BellCodeEditor

save project

parent 00d7a82f
Showing with 7 additions and 2 deletions
with open(r'C:\Users\lenovo\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines()
wer=[]
for i in a:
data=i.split()
sum=0
for e in data[1:]:
sum=sum+int(e)
asd=data[0]+str(sum)
print(asd)
asd=data[0]+str(sum)+'\n'
wer.append(asd)
with open(r'C:\Users\lenovo\Desktop\text.txt','a',encoding='utf-8') as file:
file.writelines(wer)
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