✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
import numpy as np
A = np.array([[
1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, -1], [0, 0, 0, 4]])
B = np.array([[
3, 0, 0, 0], [0, 3, 0, 0], [0, 0, 3, -2], [0, 0, 0, 1]])
det_A = np.linalg.det(A)
det_B = np.linalg.det(B)
print(
f"{det_A=}")
print(
f"{det_B=}")
Code outputdet_A=23.999999999999993
det_B=27.0