from typing import Iterable
import functools


def prod(iterable: Iterable[int]) -> int:
    """ Calculates the product of an iterable. In Python 3.8 this can be replaced with a call to math.prod """
    return functools.reduce(lambda x, y: x * y, iterable)