I have a text file which contains multiple rows of lines, I want to store each line in a list. I have tried:
data = []
with open('numbers.txt') as f:
data.append([int(x) for x in f.readline().split()])
print(data)
I know the above code stores only the 1st row, so how will I store rest of rows ?