Commit 6d8b1f0e by BellCodeEditor

auto save

parent 07f3f89b
Showing with 7 additions and 2 deletions
with open(r'c:\Users\26852\Desktop\jk.txt','r',encoding='utf_8') as jk: with open(r'c:\Users\26852\Desktop\jk.txt','r',encoding='utf_8') as jk:
a=jk.readlines() a=jk.readlines()
#print(a) #print(a)
a_sum=[]
for i in a: for i in a:
b=i.split() b=i.split()
#print(b[1:]) #print(b[1:])
sum=0 sum=0
for d in b[1:]: for d in b[1:]:
sum=sum+int(d) sum=sum+int(d)
ming=b[0]+str(sum) ming=b[0]+str(sum)+"\n"
print(ming) a_sum.append(ming)
print(a_sum)
with open(r'c:\Users\26852\Desktop\a_jk.txt','w',encoding='utf_8') as a_jk:
a_jk.writelines(a_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