Commit 424df507 by BellCodeEditor

save project

parent 85177ca7
Showing with 8 additions and 1 deletions
with open(r'C:\Users\小小洛霖\Desktop\list.txt','r',encoding='utf-8')as f:
a=f.readlines()
final_sum=[]
for i in a:
w=0
qq=i.split()
print(qq[1:])
for e in qq[1:]:
w=w+int(e)
aa=qq[0]+str(w)+"\n"
final_sum.append(aa)
with open(r'C:\Users\小小洛霖\Desktop\list.txt','a',encoding='utf-8')as f:
file.writelines(final_sum)
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