Commit 0b07904c by BellCodeEditor

save project

parent 6828ab7d
Showing with 13 additions and 1 deletions
with open(r'C:\Users\Thinkpad\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file1:
a=file1.readlines()
b=0
p=[]
for i in a:
q=i.split()
for s in q[1:]:
b+=int(s)
print(b)
result=q[0]+str(b)+'\n'
p.append(result)
b=0
with open(r'C:\Users\Thinkpad\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8') as file1:
witelines()
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