Commit 31cda77d by BellCodeEditor

save project

parent d1536a55
Showing with 17 additions and 0 deletions
a=open(r'c:\Users\LX\Desktop\sales_list.txt','r',encoding='utf-8')
b=a.readlines()
m=[]
for i in b:
data=i.split()
#print(data[0])
#print(data[1:])
sam=0
for c in data[1:]:
sam=sam+int(c)
d=data[0]+str(sam)+"\n"
m.append(d)
print(d)
a.close()
q=open(r'c:\Users\LX\Desktop\1.txt','w',encoding='utf-8')
q.writelines(m)
\ 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