how to create matrix in python code example
Example 1: numpy matrix in python 3
np.matrix([[1, 2], [3, 4]])
Example 2: how to print a matrix in python
import numpy as np
print(np.matrix(A))
Example 3: matrix using python
R = int(input("Enter the number of rows:"))
C = int(input("Enter the number of columns:"))
matrix = []
print("Enter the entries rowwise:")
for i in range(R):
a =[]
for j in range(C):
a.append(int(input()))
matrix.append(a)
for i in range(R):
for j in range(C):
print(matrix[i][j], end = " ")
print()