Python Solve Equation With Fraction