Reduce the fraction to its lowest form | Python3 program to reduce a fraction x / y to its lowest form ; Function to reduce a fraction to its lowest form ; Driver Code
from math import gcd NEW_LINE def reduceFraction ( x , y ) : NEW_LINE INDENT d = gcd ( x , y ) ; NEW_LINE x = x // d ; NEW_LINE y = y // d ; NEW_LINE print ( " x ▁ = " , x , " , ▁ y ▁ = " , y ) ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT x = 16 ; NEW_LINE y = 10 ; NEW_LINE reduceFraction ( x , y ) ; NEW_LINE DEDENT