####
# GCD calculator using euclidean algorithm
####
def euclid_gcd(x,y) :
new_gcd = y
remainder = x % y
print x,y, new_gcd, remainder
if(remainder != 0) :
euclid_gcd(y,remainder)
else :
print x,y, new_gcd, remainder
return new_gcd
print 'x | y | new_gcd | remainder'
print euclid_gcd(252,198)
However, when I run this code it returns this...
x | y | new_gcd | remainder
252 198 198 54
198 54 54 36
54 36 36 18
36 18 18 0
36 18 18 0
None
It should return 18 in this case yet it returns none where did I go wrong everything seems to be following the logical steps??