Imperative programming

def square_and_sum(lst):
    tally = 0
    for i in range(len(lst)):
        if lst[i] % 2 == 0:
            tally = tally + lst[i]**2

    return tally