CS6 - Count even Write a function called count_even_elements, which takes a list of integers and returns the number of e
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
CS6 - Count even Write a function called count_even_elements, which takes a list of integers and returns the number of e
CS6 - Count even Write a function called count_even_elements, which takes a list of integers and returns the number of elements in the list which are even. count_even_elements([]) -> 0 count_even_elements([4, 6, 5]) -> 2 count_even_elements([1, 1, -6, 3, 3, -11]) -> 1 Below the function definition, call the function passing in the arguments [1, 1, -6, 3, 3, -11] and print the return value of the function to the terminal.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!