I have a text file which contains matrix of N * M dimensions.
For example the input.txt file contains the following:
Check out this small one line code for reading matrix,
matrix = [[input() for x in range(3)] for y in range(3)]
this code will read matrix of order 3*3.