Commit 5ed5196a by BellCodeEditor

save project

parent 43a7194f
Showing with 7 additions and 3 deletions
with open('c:\\Users\\EDZ\\Desktop\\a.txt','r',encoding='utf-8') as w:
a=w.readlines()
o=[]
for i in a:
c=i.split()
s=0
for l in c[1:]:
s=s+int(l)
r=c[0]+str(s)
print(r)
\ No newline at end of file
r=c[0]+str(s)+'\n'
o.append(r)
with open('c:\\Users\\EDZ\\Desktop\\a.txt','w',encoding='utf-8') as w:
w.writelines(o)
\ 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