Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Write a Python program to perform matrix multiplication.
Answer:

import numpy as np

matrix1 = np.array([[1, 2], [3, 4]])

matrix2 = np.array([[5, 6], [7, 8]])

result = np.dot(matrix1, matrix2)

Example:

print(result)
# Output: [[19, 22], [43, 50]]
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook