home
search
help
profile
liking the experience? our app is even better
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now  
Search
showing results for
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
upvote
downvote
source
similar questions
queries leading to this page