import fractions x = fractions.Fraction(1, 3) print(x * 2)