Question: func1 Implement a function called func1 such that: funct has 3 Inputs: a, b, c (assume all of them are integters) func1 has 2 outputs:

 func1 Implement a function called func1 such that: funct has 3
Inputs: a, b, c (assume all of them are integters) func1 has
2 outputs: 0 First output is a+b+c Second output is a-b-c You

func1 Implement a function called func1 such that: funct has 3 Inputs: a, b, c (assume all of them are integters) func1 has 2 outputs: 0 First output is a+b+c Second output is a-b-c You must implement func1 in 4 lines of code or less (including function definition Ine) Sample executions of func1: resi, res2 = func1(10,2,5) print (resi) print (res2) res3 = func1(7, 2, -1) print(res3) --> 17 3 (8, 6) func2 Implement a function called func2 such that: func2 has 2 inputs: name, message When calling func2, name is mandatory When calling func2, message is optional. If no message is provided in the function call, func2 assumes message = "Hello" func2 has 1 output: a greeting message constructed as in the following examples. res = func2("John") print (res) res = func2( "Joe", "Goodbye") print (res) res = func2("Alice", "How are you") print(res) --> Hello, John Goodbye, Joe How are you, Alice func3 Implement a function called func3 such that: func3 has 2 inputs: a list and a threshold o Both are mandatory when calling func3 func3 has 1 output: It retums the average of the elements in the list whose values are greater than the threshold For example, when the list is = [0, 10, 20, 30, 40) and threshold is 15,func3 returns the average of 20, 30, 40; which is 30. When the list is = [100, 0, 55, 70, 30) and threshold is 60, func3 returns the average of 100 and 70; which is 85. 1st = [0, 10, 20, 30, 40) th = 15 res = func3(inp_list = 1st, threshold = th) print (res) 1st = [100, e, 55, 70, 30] th = 60 res = func3(threshold = th, inp_list = lst) print(res) -> 30.2 85.8 # You should change the head and body o funci # Implement header - body in 4 lines of code or shorter def func1(): pass # You should change the header and body of func2 def func2(): pass # You should change the header and body of func3 def func3(): pass def main(): resi, res2 = func1(10,2,5) print(resi) print(res2) res3 = func1(7, 2, -1) print(res3) res = func2("John") print(res) res = func2("Joe", "Goodbye") print(res) res = func2("Alice", "How are you") print(res) Ist = [0, 10, 20, 30, 40) th = 15 func3(inp_list = lst, threshold = th) print(res) Ist = (188, 8, 55, 78, 301 th = 60 res = func3(threshold = th, inp_list = lst) print(res) res =

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!