0
def gcd_fast(a, b):
    if(b > a):
        a, b = b, a


    if(a % b == 0):
        return b
    else:
        rem = a % b
        print('C:' + str(rem))
        gcd_fast(b, rem)    
print(gcd_fast(10, 9))

It returns none and when runnig it with the debugger after the return statement it jumps back to gcd_fast(a, b) in the if clause. I'm not good with python at all so sorry if it's something silly.

martineau
  • 119,623
  • 25
  • 170
  • 301
kac3pro
  • 9
  • 1
  • 1

1 Answers1

0
def gcd_fast(a, b):
    if(b > a):
        a, b = b, a


    if(a % b == 0):
        return b
    else:
        rem = a % b
        print('C:' + str(rem))
        return gcd_fast(b, rem)