def gcd(a, b): """ computes the greatest common divisor of a and b. """ if a == 0 and b == 0: ##this throws a cream pie in the caller's face. raise ValueError if a == 0: return b if b == 0: return a d = 2 out = 1 n = min(a,b) while d <= n: if b%d == 0 and a%d ==0: out = d d += 1 return out print(gcd(12,15)== 3) print(gcd(1332, 185) == 37) print(gcd(1048576, 7776) == 32) print(gcd(13244123124125, 32421421212625))