It looks like you're new here. If you want to get involved, click one of these buttons!
I am encountering a problem when I attempt to execute my code that is meant to calculate the greatest common divisor of two values. When I run the program, I get an error message stating that the function 'gcd' is not defined.
def GCD(12,4): gcd = 1 for i in range(2, max(12,4)/2): if((12 % i == 0) and (4 % i == 0)): gcd = i return gcd