Commit ac9b0b3a by BellCodeEditor

save project

parent d1536a55
Showing with 14 additions and 0 deletions
with open(r'c:\Users\Admin\Desktop\g.txt.txt','r',encoding='utf-8') as p:
a=p.readlines()
q=[]
for i in a:
s=i.split()
g=0
for x in s[1:]:
g=g+int(x)
v=s[0]+':'+str(g)+'\n'
q.append(v)
with open(r'c:\Users\Admin\Desktop\hello.txt.txt','a',encoding='utf-8') as p:
p.writelines(q)
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