Skip to content

Instantly share code, notes, and snippets.

@YDrall
Created November 5, 2016 08:16
Show Gist options
  • Save YDrall/f3bbcf507ae5fa232f5f1ee7b49a0239 to your computer and use it in GitHub Desktop.
Save YDrall/f3bbcf507ae5fa232f5f1ee7b49a0239 to your computer and use it in GitHub Desktop.
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