>>> from fractions import Fraction >>> Fraction(0.185) Fraction(3332663724254167, 18014398509481984) >>> Fraction(0.185).limit_denominator() Fraction(37, 200)