Commit 876f187a by BellCodeEditor

auto save

parent d1536a55
Showing with 14 additions and 0 deletions
with open(r'c:\Users\Administrator\Desktop\1.txt','r',encoding='utf-8') as l:
ll=l.readlines()
oo=[]
for a in ll:
a=a.split()
sum=0
for w in a[1:]:
sum+=int(w)
s=a[0]+":"+str(sum)+'\n'
oo.append(s)
with open(r'c:\Users\Administrator\Desktop\1.txt','w',encoding='utf-8') as a:
a.writelines(oo)
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