Created
September 18, 2014 01:57
-
-
Save SZanlongo/30bbde00e01ada339cb7 to your computer and use it in GitHub Desktop.
Find greatest common divisor
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
# https://stackoverflow.com/questions/691946/short-and-useful-python-snippets | |
def gcd(a, b): | |
while(b): | |
a, b = b, a % b | |
return a | |
print gcd (54, 24) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment