Commit a9a28794 by BellCodeEditor

save project

parent 5654493e
Showing with 13 additions and 0 deletions
with open(r"C:\Users\maku\Desktop\新建文本文档.txt",'r',encoding='utf-8')as laji:
b=laji.readlines()
a=[]
for i in b:
f=i.split()
j=0
for c in f[1:0]:
j=j+int(c)
r=f[0]+str(j)+'\n'
a.append(r)
with open(r"C:\Users\maku\Desktop\新建文本文档.txt",'r',encoding='utf-8')as laji:
laji.writelines(a)
\ 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