Answers for "python how to take input in a 2d array"

1

take input in 2d list in python

matrix = [input().split() for i in range(no_of_rows)] # if only row is given and the number of coloumn has to be decide by user
matrix= [[input() for j in range(no_of_cols)] for i in range(no_of_rows)] # if both row and coloumn has been taken as input from user
Posted by: Guest on April-27-2020

Code answers related to "python how to take input in a 2d array"

Python Answers by Framework

Browse Popular Code Answers by Language