0
What's wrong with my code??
def gcd(m,n): m=int(input()) n=int(imput()) i=min(m,n) while i>0: if ((m%i)==0 and (n%i)==0): return(i) else: i=i-1 print(gcd(m,n))
1 Answer
+ 1
It's not necessary to create a question again, and your priority is to understand the basic syntax.
spell, indent, function logic, error prompt from IDE
def gcd(m, n):
i = min(m, n)
while i > 0:
if ((m % i) == 0 and (n % i) == 0):
return(i)
else:
i = i - 1
a = int(input())
b = int(input())
print(gcd(a, b))