Commit 40b793c9 by BellCodeEditor

save project

parent d1536a55
Showing with 16 additions and 0 deletions
a=open(r'c:\Users\Administrator\Desktop\sales_list.txt','r',encoding='utf-8')
b=a.readlines()
f=[]
for i in b:
date=i.split()
#print(date[0])
#print(date[1:])
sum=0
for c in date[1:]:
sum=sum+int(c)
d=date[0]+str(sum)+'\n'
f.append(d)
a.close()
e=open(r'c:\Users\Administrator\Desktop\nihao.txt','w',encoding='utf-8')
e.writelines(f)
\ 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