Created
March 5, 2012 15:47
-
-
Save soimort/1978917 to your computer and use it in GitHub Desktop.
Project Euler - Problem 5
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): | |
if a: | |
return gcd(b % a, a) | |
else: | |
return b | |
lcm = lambda a, b: a * b // gcd(a, b) | |
m = 1 | |
for i in range(2, 21): | |
m = lcm(m, i) | |
print(m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment