Created
March 13, 2012 10:50
-
-
Save shieldsd/2028103 to your computer and use it in GitHub Desktop.
Project Euler #5
This file contains hidden or 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(i, j): | |
while j: | |
i, j = j, i % j | |
return i | |
def lcm(i, j): | |
return i * j / gcd(i, j) | |
print reduce(lcm, range(1, 21)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment