Answer:
def list_intersection(list1, list2):
intersected_list = [number for number in list1 if number in list2]
return intersected_list
list1 = [11, 5, 676, 0, 42, 32]
list2 = [0, 89, 211, 11]
print(list_intersection(list1, list2))
Step-by-step explanation:
- Inside the function, create a new list called intersected_list to check if any number in list1 is also in the list2. If a match is found put the number in the intersected_list. * Take a look how Python enables us to do this with just one line of code
- Then create two lists to compare
- Call the function and print the result