def factorial(n):
    """A factorial of n (n!) is defined as the product of all positive integers
    less then or equal to n. According to the convention for an empty product,
    the value of factorial(0) (0!) is 1.

    >>> [factorial(i) for i in range(11)]
    [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800]
    """

    # The stopping criterion is when we reach 1 or less
    if n <= 1:
        return 1
    # n! = n * (n-1) * (n-2) * ... * 2 * 1, therefore
    # n! = n * (n-1)!
    return n * factorial(n-1)