take matrix input from user in python

Solutions on MaxInterview for take matrix input from user in python by the best coders in the world

showing results for - "take matrix input from user in python"
Sofia
12 Jun 2017
1# Taking one row at a time with space-separated values.
2# And converting each of them to using map and int function.
3
4matrix = []
5for i in range(row):
6   col = list(map(int, input().split()))
7   matrix.append(col)
8print(matrix)
9
10'''
11Input :
121 2
133 4
14Output :
15[[1, 2], [3, 4]]
16'''