'Finding eigenvalues without using eig function

I am finding the eigenvalues of the matrix without using the function (eig) in python. I do not know how to make a variable to store the unknown lambda.

def pre_determinant(matrix):
    x = symbols('x')
    x = float(x)
    for num in range(len(matrix)):
        matrix[num,num] -= x
    return matrix


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source