Commit b9d1d034 by BellCodeEditor

save project

parent 3a163063
Showing with 13 additions and 7 deletions
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines()
for i in a:
dsb=[]
for s in a:
b=0
i_1=i.split()
#print(i_1[1:])
for k in i_1[1:]:
s_1=s.split()
#print(s_1[1:])
for k in s_1[1:]:
b+=int(k)
print(b)
\ No newline at end of file
#print(b)
sb=s_1[0]+str(b)+'\n'
#print(sb)
dsb.append(sb)
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8') as file1:
file1.writelines(dsb)
\ 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