https://github.com/Ahmed-Sh/Matrix
The above link shows my code for a function calculating the Determinant of a matrix, I noticed three things:
The function is working fine when using it outside the class,and when tried to make a class and use the same function build just changing the names to be self.names of some variables the function gives me the error message: self.co_factors = [[sign_mat[i][j] * self.det(self.minors[i][j]) for j in range(len(self.minors))]for i in range(len(self.minors))] IndexError: list index out of range
I changed the name of the variable self.minor to minor in all necessary positions, the function worked fine with no errors!!!,why it’s working alone and not in the class and what the variable name changing got to do with it !!!
I see a warning message in Pycharm on the same variable when calling it inside the function to do the recursion saying Type ‘int’ doesn’t have expected attribute’__ len__ ‘,’__ getitem__’ ,what does it mean? Thank you for your help