Comments

f1=open('input.txt') f2=open('output.txt','w')

code for sum of n numbers

summ=0 for i in range(int(f1.readline())): summ+=int(f1.readline()) f2.write(str(summ))

f1.close() f2.close()

this is for python to add your input and output file , you can check it