def combination(n, k , repetition = False): 
    """
    Returns binomial coefficient.

    Parameters 
    ----------
    n : int
        non-negative integer
    k : int
        non-negative integer
    return : int
        returns integer value denoting binomial coefficient
    
    Optional Parameters
    -------------------
    repetition : bool
        By default , it is false.
        If set to 'True' , then it denotes that repetition is allowed

    """
    if(n < 0 or k<0):
        raise ValueError(
            "n and k must be non-negative"
        )

    if(repetition == False):
        if(k > n - k): 
            k = n - k 
        
        res = 1
        
        for i in range(k): 
            res = res * (n - i) 
            res = res / (i + 1) 
        return int(res) 
    else:
        return combination(n + k - 1 , k)