Python Rational Number Classification Definition