Calculate the binomial coefficient indexed by n and k.

    Args:
        n (int): positive integer
        k (int): positive integer

    Returns:
        The binomial coefficient indexed by n and k

    Raises:
        TypeError: If either n or k is not an integer
        ValueError: If either n or k is negative, or if k is strictly greater than n

def binomial_coefficient(n, k):

    """ Calculate the binomial coefficient indexed by n and k.

    Args:
        n (int): positive integer
        k (int): positive integer

    Returns:
        The binomial coefficient indexed by n and k

    Raises:
        TypeError: If either n or k is not an integer
        ValueError: If either n or k is negative, or if k is strictly greater than n

    """

    if not isinstance(k, int) or not isinstance(n, int):
        raise TypeError("Expecting positive integers")
    if k > n:
        raise ValueError("k must be lower or equal than n")
    if k < 0 or n < 0:
        raise ValueError("Expecting positive integers")

    return factorial(n) // (factorial(k) * factorial(n - k))