Answers for "print 2 dimensional array python"

1

how to input 2-d array 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
0

how to print a matrix in python

import numpy as np
print(np.matrix(A))
Posted by: Guest on March-02-2020

Code answers related to "print 2 dimensional array python"

Python Answers by Framework

Browse Popular Code Answers by Language