playbook/antigravity-awesome-skills/skills/loki-mode/benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/85.py

12 lines
288 B
Python

def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
Examples:
add([4, 2, 6, 7]) ==> 2
"""
total = 0
for i in range(1, len(lst), 2):
if lst[i] % 2 == 0:
total += lst[i]
return total