Question: # 3) Finish the function that is started below. Make a new list # that contains in order from left to right every element of
# 3) Finish the function that is started below. Make a new list # that contains in order from left to right every element of input_list # that has an even index number. # Return that new list. This is an example of an accumulation loop # with a list - look at the end of Lec 7 for an example of this. # Finish this function by replacing the return line with your own lines # of code. def even_elements(input_list): return "replace this line with your code" # The function is called with this data even_vals = even_elements([2,3,4,5,6,7,8,9]) print(even_vals) # The test code above should produce #[2, 4, 6, 8] # once you implement the function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
