Consider two lists of integers, where each list is a set (i.e., contains no duplicate values). The intersection of these two sets will be a list containing only those integers that appear in both of the source lists/sets. For example, given the lists [1, 2, 3, 4, 5] and [2, 4, 6, 8, 10], their intersection would be the list [2, 4] (note that the source lists and the intersection set do not need to contain values in sorted order).
Complete the intersection() function, which takes two integer lists as its arguments. This function returns a Python list whose only elements are those integers that appear in both of the list parameters. If the two source lists have no elements in common, then your function should return an empty list.
Function Call
intersection([1,2,3,4,5], [2,4,6,8,10])
Return Value
[2, 4]
Function Call
intersection([12,45,91], [36,91])
Return value
[91]
Function Call
intersection([2,3,4,5,6], [7,8,9,10,11])
Return value
Please help I don’t know how to write out the function !!!