Question: [l]: [2]: [3]: [4]: a) [10 pts] Define a function called is_even that takes an integer as a parameter and returns True if the given
![[l]: [2]: [3]: [4]: a) [10 pts] Define a function called](https://s3.amazonaws.com/si.experts.images/answers/2024/06/6678489ae59d5_9386678489ac9732.jpg)
[l]: [2]: [3]: [4]: a) [10 pts] Define a function called is_even that takes an integer as a parameter and returns True if the given integer is Even. A integer is said to be even if the modulo(%) of the integer equals 0 . For example, 4 is even (4%2 = 0), but 5 is not (5%2 =1). #INSERT YOUR ANSWER HERE. b) [10 pts] Modify the is_even function you created in Q1.a to take a floating-point number as an input and return True if the ceiling of the input is Even. For example, 12 . 5 is not even, but 11 . 25 is even. #INSERT YOUR ANSWER HERE. c) [10 pts] Define a function called is_even_vec that calls is Even function you updated in Q1.b to take a list of floating-point or integer numbers and return their results in a list. For example, given [1441. 25, 231. 5, 23] the function returns [True, True, False] #INSERT YOUR ANSWER HERE. d) [10 pts] Define a function called is_even_dict that calls is_even_vec and returns the results in a dictionary with their corresponding input elements. For example, given [1441.25, 231.5, 23] the function returns {1441.25: True, 231.5: True, 23: False} #INSERT YOUR ANSWER HERE. e) [10 pts] Define a function called isEvenTuple by modifying the function you created in Q1.d to traverse the values of the returned dictionary in reverse order and return the dictionary keys that have a TRUE value as a tuple. For example, given [1441 .25, 231. 5, 23] the function returns (231.5, 1441.25)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
