on to the next section to see how the two compare fraction type python and debuted new numeric typefractionwhich implements rational number object it essentially keeps both numerator and denominator explicitlyso as to avoid some of the inaccuracies and limitations of floating-point math like decimalsfractions do not map as closely to computer hardware as floating-point numbers this means their performance may not be as goodbut it also allows them to provide extra utility in standard tool where required or useful fraction basics fraction is functional cousin to the decimal fixed-precision type described in the prior sectionas both can be used to address the floating-point type' numerical inaccuracies it' also used in similar ways--like decimalfraction resides in moduleimport its constructor and pass in numerator and denominator to make one (among other schemesthe following interaction shows howfrom fractions import fraction fraction( fraction( numeratordenominator simplified to by gcd fraction( fraction( print( / once createdfractions can be used in mathematical expressions as usualx fraction( fraction(- fraction( results are exactnumeratordenominator fraction objects can also be created from floating-point number stringsmuch like decimalsfraction( 'fraction( fraction(' 'fraction( fraction( 'fraction(' 'fraction( numeric types