Skip to content

Instantly share code, notes, and snippets.

@SZanlongo
Created September 18, 2014 01:57
Show Gist options
  • Save SZanlongo/30bbde00e01ada339cb7 to your computer and use it in GitHub Desktop.
Save SZanlongo/30bbde00e01ada339cb7 to your computer and use it in GitHub Desktop.
Find greatest common divisor
# 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