from functools import reduce
from operator import mul


def prod(iterable):
    """Product of all values in an iterable, like sum() but for multiplication."""
    # NOTE: in Python 3.8 this is now available as math.prod()
    return reduce(mul, iterable, 1)