Answers for "how to initialize a matrix in python"

1

python initialize matrix

# Declaring rows
N = 5
  
# Declaring columns
M = 4
  
# using list comprehension 
# to initializing matrix
res = [ [ 0 for i in range(M) ] for j in range(N) ]
Posted by: Guest on June-28-2021

Code answers related to "how to initialize a matrix in python"

Python Answers by Framework

Browse Popular Code Answers by Language