Question: Problem 3 - Functional Programming (10 points) Function Description: Write a function, winning_function () that takes three parameters as input: a list of integers and

 Problem 3 - Functional Programming (10 points) Function Description: Write a

Problem 3 - Functional Programming (10 points) Function Description: Write a function, winning_function () that takes three parameters as input: a list of integers and two functions that each take an integer as input and return a Boolean value. winning_function () will then count how many times each function returns True when applied to the elements of the input list. The function that returns True the most is the winning function. Return the name of the winning function as a string. If both functions return True the same number of times, then return the string, 'TIE'. For this problem, we will pass the even () and odd () functions towinning_function (): For example, if the input list is a=[2,3,4,5,6,8], then calling winning_function(a, even, odd) would return 'even' because the even () function will return True 4 times when applied to the elements of the list a, while the odd () function will only return True 3 times

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 Databases Questions!