Skip to content

Instantly share code, notes, and snippets.

@jweinst1
Created July 8, 2015 01:40
Show Gist options
  • Save jweinst1/a01a46051876b39138e5 to your computer and use it in GitHub Desktop.
Save jweinst1/a01a46051876b39138e5 to your computer and use it in GitHub Desktop.
GCD one liner.py
def gcd(a, b):
return max([n for n in range(1, min(a, b)+1) if a%n == 0 and b%n == 0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment