def pascal(n, i):
    """Get the element value at the nth level and the ith
    index for Pascal's triangle. Levels are 0 at top, and
    increasing number descending; e.g. indexes
    Level 0             0
    Level 1           0   1
    Level 2         0   1   2
    Level 3       0   1   2   3
    etc

    to return values;
    Level 0             1
    Level 1           1   1
    Level 2         1   2   1
    Level 3       1   3   3   1
    etc

    """
    if i > n:
        return 0
    if i in [0, n]:
        return 1
    else:
        sum = (pascal(n - 1, i - 1) + pascal(n - 1, i))
    return sum