#In python, matrices are represented as follows: identity = [[1, 0], [0, 1]] #To add matrices: matrix_one = [[2, 3, 4], [10,11,12], [6,7,8]] matrix_two = [[3, 9, 12], [9,11,14], [1,7,16]] matrix_three= [[0,0,0], [0,0,0], [0,0,0]] matrix_length = len(matrix_one) for i in range(len(matrix_one)): for k in range(len(matrix_two)): matrix_three[i][k] = matrix_one[i][k] + matrix_two[i][k] print(matrix_three) #To multiply matrices: matrix_one = [[2, 3, 4], [10,11,12], [6,7,8]] matrix_two = [[3, 9, 12], [9,11,14], [1,7,16]] matrix_three= [[0,0,0], [0,0,0], [0,0,0]] matrix_length = len(matrix_one) for i in range(len(matrix_one)): for k in range(len(matrix_two)): matrix_three[i][k] = matrix_one[i][k] * matrix_two[i][k] print(matrix_three) #Using a NumPy array import numpy as np matrix_one = np.array([[2, 3, 4], [10,11,12], [6,7,8]]) matrix_two = np.array([[3, 9, 12], [9,11,14], [1,7,16]]) matrix_three = matrix_one + matrix_two matrix_four = matrix_one*matrix_two