Examples :
Input: d = 2.5 Output: 5/2 Explanation: 5/2 gives 2.5 which is the reduced form of any fraction that gives 2.5 Input: d = 1.5 Output: 3/2
Python as_integer_ratio () Function:
Returns a pair of integers whose ratio is exactly equal to the original floating point value and has a positive denominator.
Syntax:
float. as_integer_ratio ()
Return Value:
Tupple (a pair of integers)
Errors:
Raises OverflowError on infinities and a ValueError on NaNs.
In Python, we have a builtin function as_integer_ratio (), that prints the reduced fractional form of any given rational number d. We need to store this in any variable and then print the 0th index and 1st index of the stored fraction.

Exit :
5/2