A Python script that calculates the determinant of a square matrix using the method of cofactor expansion. The program is designed to handle matrices of any size and will return the determinant of the given matrix.
- Handles square matrices of any size.
- Calculates determinant using cofactor expansion.
- Includes example matrices for testing.
- Functions
minor
anddeterminant
can be imported for external usage.
- Clone the repository to your local machine.
- Run the script with Python 3:
python3 cofactor-expansion.py
Alternatively, you can import the minor and determinant functions for usage in other scripts or projects:
from cofactor_expansion import minor, determinant