Python Check If Number Is Rational