Commit cf659a11 by BellCodeEditor

save project

parent ab2ec3df
Showing with 6 additions and 2 deletions
with open(r'c:\Users\lenovo\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as a: with open(r'c:\Users\lenovo\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as a:
b=a.readlines() b=a.readlines()
j=[]
for i in b: for i in b:
c=i.split() c=i.split()
f=0 f=0
for e in c[1:]: for e in c[1:]:
f=f+int(e) f=f+int(e)
print(c[0]+str(f)) g = c[0]+str(f)+'\n'
\ No newline at end of file j.append(g)
with open(r'C:\Users\lenovo\Desktop\text.txt','a',encoding='utf-8') as a:
a.writelines(j)
\ 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