• Some feedback about the compiler error

Question related to mission Even the Last

 

I would like to give some feedback about the compiler error When the input is checkio([-37,-36,-19,-99,29,20,3,-7,-64,84,36,62,26,-76,55,-24,84,49,-65,41]) and my code as shown below

def checkio(array):
    last=len(array)
    sum=0
    if not last==0:        
        for x in array:            
            if array.index(x)%2==0: 
                print(x)
                sum+=x  
        return sum*array[last-1]       
    else:    
        return 0

the element list in array even index should return -37-19+29+3-64+36+26+55+84-65 but if the array.index[16] = 84 , the list will not show 84. Only if array.index[16] != 84 , the list will be normal.

From: https://py.checkio.org/mission/even-last/solve/

HTTP_USER_AGENT:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36