I am new to python and I am just writing a simple recursive function to return the GCD of two integers. If I use a print statement in the gcd function, the function works just fine. But, if I get the function to return the value and try to print the return value outside the function, nothing is printed. This might be a small problem but I have tried numerous things and nothing worked. What am I doing wrong here?
def gcd(m,n):
if m==n:
return m
else:
if m>n:
gcd(m-n,n)
else:
gcd(m,n-m)
m=int(input('Enter first number'))
n=int(input('Enter second number'))
out=gcd(m,n)
print(out)