# 30 seconds of python

Back to Home#### gcd

mathbeginnerCalculates the greatest common divisor of a list of numbers.

Use `reduce()`

and `math.gcd`

over the given list.

from functools import reduce import math def gcd(numbers): return reduce(math.gcd, numbers)