Question: in python Write a function list_difference(numlist1, numlist2) that takes in two lists as parameters. These lists contain numeric values and have the same length. Have
in python
Write a function list_difference(numlist1, numlist2) that takes in two lists as parameters. These lists contain numeric values and have the same length. Have the function return a new list that contains the difference between respective items in numlist1 and numlist2, without mutating either of the given lists. You are welcome to add an if __name__ == '_ main_' block and test cases for this and all functions in this assignment but this is not required. Examples (text in bold is returned): > alist =[5,6,7] > blist =[2,2,2] > list_difference(alist, blist) [3,4,5] >> alist [5,6,7] >> blist [2,2,2] >> list_difference ([0,1,1,2],[3,5,8,13]) [3,4,7,11] >>> list_difference ([],[]) []
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
