Created
November 5, 2016 08:16
-
-
Save YDrall/f3bbcf507ae5fa232f5f1ee7b49a0239 to your computer and use it in GitHub Desktop.
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(a,b): | |
while(b!=0): | |
a,b=b,a%b | |
return a | |
def lcm(*args): | |
from functools import reduce | |
import math | |
return reduce(lambda a,b:(a*b)/math.gcd(int(a),int(b)), args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment