FunctionRacerProblemsRace

Every Other Sum

BeginnerNumPyPython

Add up the numbers of nums at indexes 0, 2, 4, and so on (every other one, starting with the first). Return the total as an int. Hint: slicing with a step, like nums[::2].

Example 1

nums [10,1,20,2,30]
returns 60

10 + 20 + 30 = 60.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems