def    dbal(c, s, r, l):
    """ This accountancy function computes declining balance
    depreciation for an asset purchased for cash with
    a known life span and salvage value.  The depreciation
    is returned as a list in Python.
    c = historcal cost or price paid
    s = the expected salvage proceeds
    r = declining percetage rate(ie 1, 1.2, 1.75 or double 2)
    l = expected useful life of the fixed asset
    Example: dbal(1000, 100, 1.5, 5) for 150% declining
    Example: dbal(1000, 100, 2, 5) for double declining
    """
    ad = 0
    res = []
    for x in range(l):
        if x == (l -1):
            dexp = (c - s -ad)
        else: 
            dexp = (((c)/l)/(c) * r) * (c - ad)
        res.append(dexp)
        ad = ad + dexp
    return res