Commit c84f16b5 by BellCodeEditor

save project

parent 9b58c893
Showing with 6 additions and 2 deletions
with open(r'C:\Users\Administrator\Desktop\12.txt','r',encoding='utf-8') as c:
a=c.readlines()
d=[]
for i in a:
x=i.split()
n=0
for v in x[1:]:
n=n+int(v)
k=x[0]+':'+str(n)
print(k)
k=x[0]+':'+str(n)+'\n'
d.append(k)
with open(r'C:\Users\Administrator\Desktop\123.txt','a',encoding='utf-8') as c:
c.writelines(d)
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