Question: Python- write a function list_diff() that is passed the running list of integers and a second list of integers. (Prompt for and read the second
Python- write a function list_diff() that is passed the running list of integers and a second list of integers. (Prompt for and read the second list of integers before the function call and pass it (and the original list) to the function.) The function should return a list of all the integers in the running list that are not also in the second list. For example, if the two lists are [5, 1, 4, 2] (as the running list) and [6, 1, 4, 3] (as the second list), the function should return [5, 2]. Use filter and convert the filter application to a list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
