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:
a=asd.readlines()
# print(a)
t=[]
for i in a:
b=i.split()
#print(b[1:])
s=0
for d in b[1:]:
s=s+int(d)
x=b[0]+str(s)
print(x)
\ No newline at end of file
x=b[0]+str(s)+"\n"
t.append(x)
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