import fractions print(fractions.Fraction(1.5)) print(fractions.Fraction(5)) print(fractions.Fraction(1,3))