from fractions import Fraction x,y,n=int(input()),int(input()),int(input())
f=Fraction(x,y).limit_denominator(n)
print(str(f.numerator)+"/"+str(f.denominator))
I have submitted the code bt shows runtime error on test 1 can anyone help me please?
b. nearest fraction
from fractions import Fraction x,y,n=int(input()),int(input()),int(input())
f=Fraction(x,y).limit_denominator(n)
print(str(f.numerator)+"/"+str(f.denominator))
I have submitted the code bt shows runtime error on test 1 can anyone help me please?