Skip to content

Instantly share code, notes, and snippets.



Created Jul 12, 2013
What would you like to do?
LCM function for python.
def lcm(*numbers):
"""Return lowest common multiple."""
def lcm(a, b):
return (a * b) // gcd(a, b)
return reduce(lcm, numbers, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment