pyassistant

Sum of Even Numbers Up to Index

Given a list of integers, return a new list where each element is the sum of all the even numbers in the original list up to that index.

Example:

Input:
[1, 2, 3, 4, 5]
Output:
[0, 2, 2, 6, 6]

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.