Commit 24fc1e45 by BellCodeEditor

save project

parent eba49236
Showing with 6 additions and 3 deletions
...@@ -2,11 +2,14 @@ with open(r"C:\Users\A23\Desktop\wer.txt","r",encoding="utf-8")as asd: ...@@ -2,11 +2,14 @@ with open(r"C:\Users\A23\Desktop\wer.txt","r",encoding="utf-8")as asd:
a=asd.readlines() a=asd.readlines()
# print(a) # print(a)
t=[]
for i in a: for i in a:
b=i.split() b=i.split()
#print(b[1:]) #print(b[1:])
s=0 s=0
for d in b[1:]: for d in b[1:]:
s=s+int(d) s=s+int(d)
x=b[0]+str(s) x=b[0]+str(s)+"\n"
print(x) t.append(x)
\ No newline at end of file with open(r"C:\Users\A23\Desktop\wer.txt","a",encoding="utf-8")as asd:
asd.writelines(t)
\ 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