I am new to python, I'm trying to take input of 2 numbers in a line T number of times, then store it in a list and calculate the sum of each two pairs of numbers in the list, but my list only stores the last two inputted numbers. It wont store anything before last new line. How can I store all the input ?
from operator import add
t = int(input())
i = 0
while i < t:
n = input()
L = list(map(int, n.split()))
i += 1
sumL = (list(map(add, *[iter(L)]*2)))
print (sumL)