I have a file of numbers separated by space, like this:
1 2 3 4
2 5 1 4
3 2 1 3
2 3 4 5
I want to write a python program that takes this file as input and store them in a list of list:
[[1, 2, 3,4], [2, 5, 1, 4], [3, 2, 1,3], [2, 3, 4, 5]]
Do you have any idea how can I do that? my code is as below to read the file.
file_text = open("text", "r")
file = file_text.read()
I am trying solutions of the related problem asked before, but I am getting error(ValueError: too many values to unpack). I am a bit confused. I would be happy if anyone could help me with that.