Quick actions

cmd+k|ctrl+k

Navigation

Languages

GCD Euclidean Algorithm

Snippet info

Language

Python

Visibility

public

Author

dharmendrarah

Created

2023-01-14T11:12:29.500078Z

Updated

2023-01-14T11:13:10.609501Z

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def euclidean_algorithm(a, b):
    return gcd(a, b)

print(euclidean_algorithm(60, 48)) # output: 12
INFO