Question: Python exercise 1 : def mylinear(x): y = 2*x + 5 return y (a) Write a function that takes a list and a function as

Python

Python exercise 1 : def mylinear(x): y = 2*x + 5 return

exercise 1 :

def mylinear(x):

y = 2*x + 5

return y

(a) Write a function that takes a list and a function as its arguments. The function should evaluate the passed function on the first entry, second-to-last entry, maximum, and minimum of the list. Remember to return the results. List comprehension might be useful. (b) Call your function on testlist2 = [-7, -1, -12, 0, 2, 5, 7, 8] and use the linear function you wrote in Exercise 1 as the function argument

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!