Made rational class in python