<prompt> Andika kazi ambayo inachukua safu na anarudi safu mpya na tu hata idadi kutoka safu ya awali.1, 2, 3, 4, 5, 6, 7, 8  <response>: Here is a function written in Python that implements the required functionality:pythondef filter_even_numbersarr: Creating an empty list to store even numbers even_numbers Iterating over elements of the input list for elem in arr: Checking if the current element is even if elem 2 0: even_numbers.appendelem Returning the final list of even numbers return even_numbersNow, lets test this function with the input array provided in the prompt:pythontest_array 1, 2, 3, 4, 5, 6, 7, 8result filter_even_numberstest_arrayprintresultThis will output:2, 4, 6, 8This shows that our function is correctly filtering out the even numbers from the given input array. 