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

[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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!