Your question is Even Elements in Array. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Add the even elements in an array.
Implement sum_even_elements(nums), which accepts an array of integers and returns the sum of every even element. Return 0 when the array is empty or contains no even values.
Input: nums, a list of integers.
Output: An integer representing the sum of the even elements.
Example: nums = [1, 4, 7, 10] returns 14 because 4 + 10 = 14.
def sum_even_elements(nums):