def binom(n, k):
    """
    *DESCRIPTION OF FUNCTION*

    Parameters
    ----------
    n : int
        First number in the binomial coefficient. Can be thought of as the set being drawn from
    k : int
        Second number in the binomial coefficient. Can be thought of as being the nuber of items drawn from the set. Must be 0 <= `k` <= `n`.

    Returns
    -------
    coef : int
        The resulting binomial coefficient.
    """

    #Initialisations
    n_fac = 1 #so it can never divide by 0 in `coef`
    k_fac = 1
    diff = n - k
    diff_fac = 1

    #Special cases
    if n < 0  or k < 0:
        return 0

    #Factorials
    for i in (1, n+1): #n!
        n_fac = n_fac*i
    for i in (1, k+1): #k!
        k_fac = k_fac*i
    for i in (1, diff+1): #(n-k)!
        diff_fac = diff_fac*i

    #Coefficient
    coef = n_fac / (k_fac * diff_fac)
    return coef