Brute Force Equation Solver In Python