Exercise 1: Extract Even Elements from an Array
Extract the even numbers from an array.
We'll cover the following
Problem statement
Extract the even integers from the given array.
Example
input_array contains [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Output is [2, 4, 6, 8, 10]
Try it yourself
def even_elements(input_array)result = []# Start your code herereturn resultend