This is how you do it in python:
Code:
def everyother(array):
return array[::2]
example_array = [0, 1, 2, 3, 4, 5]
print(everyother(example_array))
Output:
[0, 2, 4]
Explenation:
The key to this problem is "array[::2]".
Array[start : stop : step]
Writing "array[::2]" is the same as writing:
Array[0 : -1 : 2] or Begin at 0, stop at the end and take every 2:nd value