def factorial(n: int) -> int:
    """
    Calculate the factorial of a number.
    Use a loop to multiply the integers from 1 through n.

    Parameters
    ----------
    n : int
        The nonnegative number to calculate the factorial of.

    Returns
    -------
    int
        The factorial of 'n'. The factorial of 0 is 1.

    Examples
    --------
    >>> factorial(5)
    120
    >>> factorial(0)
    1
    """
    raise NotImplementedError("Replace this line with your code.")
