Euclidean Algorithm / GCD in Python - Stack Overflow

PHOTO EMBED

Fri Jun 03 2022 10:33:05 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? ")) 
r=a%b
while r:
    a=b
    b=r
    r=a%b
print('GCD is:', b)
content_copyCOPY

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