Start of main content## More like this

Returns the least common multiple of a list of numbers.

- Use
`functools.reduce()`

,`math.gcd()`

and`lcm(x, y) = x * y / gcd(x, y)`

over the given list.

```
from functools import reduce
from math import gcd
def lcm(numbers):
return reduce((lambda x, y: int(x * y / gcd(x, y))), numbers)
```

```
lcm([12, 7]) # 84
lcm([1, 3, 4, 5]) # 60
```

### Greatest common divisor

Python, Math

Calculates the greatest common divisor of a list of numbers.

### Digitize number

Python, Math

Converts a number to a list of digits.

### Median

Python, Math

Finds the median of a list of numbers.