Euclidean Algorithm / GCD in Python - Stack Overflow

PHOTO EMBED

Fri Jun 03 2022 10:33:08 GMT+0000 (Coordinated Universal Time)

Saved by @Intregal #python

a = int(input("What's the first number? "))
b = int(input("What's the second number? ")) 
while 1:
    r=a%b
    if not r:
        break
    a=b
    b=r
print('GCD is:', b)
content_copyCOPY

https://stackoverflow.com/questions/21608593/euclidean-algorithm-gcd-in-python