from typing import List
from functools import reduce


def product(li: List[int]) -> int:
    """Calculates the product of all the numbers in a list.

    doctests:
    >>> product([2, 1, 4])
    8
    >>> product([3, 1, 4, 2, 5, 8])
    960
    """

    x = reduce(lambda a, b: a * b, li)

    return x