>>> from fractions import Fraction >>> x = Fraction(22,7) >>> y = 3 >>> print(x,x/2,x//2) 22/7 11/7 1 >>> print(y,y/2,y//2) 3 1.5 1