Last active
October 18, 2020 04:05
-
-
Save kendallm/2968b85a2760f77b2ac328a672516c75 to your computer and use it in GitHub Desktop.
Computes GCD of x,y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def euclid(x,y): | |
if x < y: | |
temp = y | |
y = x | |
x = temp | |
if y == 0: | |
return x | |
return euclid(y, x % y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment