• What's wrong?(Even the last)

Question related to mission Even the last


My code works fine when I run it in the Python IDLE, but does not work on the site

def checkio(array):
    total = 0
    if len(array) != 0:
        for i in range(len(array)):
            if i % 2 == 0:
                total += i
        total *= array[-1]
        return total
        return 0

so what's the problem?