Brute Force Equation Solver Python