def find_eigenvalues_by_scanning(A, low=-10, high=10, step=0.001): n = len(A) identity = np.eye(n) found = [] prev_sign = None lam = low while lam <= high: test_matrix = A - lam * identity value = det(test_matrix) current_sign = value > 0 if prev_sign is not None and current_sign != prev_sign: found.append(round(lam, 2)) prev_sign = current_sign lam += step return found A = np.array([[2, 1], [1, 2]]) print(find_eigenvalues_by_scanning(A)) __ __