Questions
Write a python program to multiply two dimensional matrices.
Last Updated : 26 Jul 2026
Jul 23
Solution:
# Input matrices
A = [[1, 2, 3],
[4, 5, 6]]
B = [[7, 8],
[9, 10],
[11, 12]]
# Result matrix with zeros
result = [[0, 0],
[0, 0]]
# Matrix multiplication
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]
# Display result
print("Result of Matrix Multiplication:")
for row in result:
print(row)
Report an error