def amortization(loan, r, c, n):
    """Amortization

    Returns: The amount of money that needs to be paid at the end of
    each period to get rid of the total loan.

    Input values:
    loan : Total loan amount
    r : annual interest rate
    c : number of compounding periods a year
    n : total number of compounding periods
    """
    ipp = r / c
    amt = (loan * ipp) / (1 - ((1 + ipp) ** (-n)))
    return amt