1numbers = []
2
3#Open the file
4with open('file.txt') as fp:
5 #Iterate through each line
6 for line in fp:
7
8 numbers.extend( #Append the list of numbers to the result array
9 [int(item) #Convert each number to an integer
10 for item in line.split() #Split each line of whitespace
11 ])
12
13print(numbers)
14