The non-recursive version is below:
def mdc(a,b):
while b !=0:
resto = a % b
a = b
b = resto
return a
print(mdc(50,2))
A recursive attempt would be:
def mdc(a, b):
if b == 0:
return a
resto = a % b
a = b
b = resto
return mdc(a, b)
What do you think? Any other solution?