Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. P is an index of an array A.Input:A[0] = -1A[1] =  3A[2] = -4A[3] =  5A[4] =  1A[5] = -6A[6] =  2A[7] =  1Output:1371 is an equilibrium index of this array, because:A[0] = 1 = A[2] + A[3] + A[4] + A[5] + A[6] + A[7]3 is an equilibrium index of this array, because:A[0] + A[1] + A[2] = 2 = A[4] + A[5] + A[6] + A[7]7 is also an equilibrium index, because:A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] = 0My solution for review:def isEquilibrium(alist, ind):    listLen = len(alist)    left = getSum(0, ind, alist)    right = getSum(ind+1, listLen, alist)    # print left, right    if left == right:        return Truedef getSum(start, end, lis):    tot = 0    for i in xrange(start, end):        tot = tot + lis[i]    return totdef solution(alist):    for i in xrange(0, len(alist)):        result = isEquilibrium(alist, i)        if(result):            print isolution([-1,3,-4,5,1,-6,2,1])
Finding an equilibrium of an index of an array
python;python 2.7;reinventing the wheel