def find_gcd(num1, num2):
if num2 == 0:
return num1
else:
return find_gcd(num2, num1 % num2)
# Example usage
print("GCD of 12 and 18 is", find_gcd(12, 18))
GCD of 12 and 18 is 6
find_gcd()
` function takes two numbers as input parameters and returns their GCD. GCD
. If `num2
` is equal to zero, then `num1
` is the GCD of the two numbers. Otherwise, the function calls itself with `num2
` as the first parameter and the remainder of `num1
` divided by `num2` as the second parameter.