Created
July 8, 2015 01:40
-
-
Save jweinst1/a01a46051876b39138e5 to your computer and use it in GitHub Desktop.
GCD one liner.py
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 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