Question: Python Program Create a function sym dif(list1, list2) that takes in two lists, makes them sets, and then returns their symmetric difference. The symmetric difference
Python Program
Create a function sym dif(list1, list2) that takes in two lists, makes them sets, and then returns their symmetric difference. The symmetric difference of two sets A and B, is a set AB that contains only the elements exclusive to A and B. In other words, it contains the elements that are in A (but not B) as well as the elements in B (but not A).
sym dif([1, 2, 3], [3, 4, 5]) would return [1, 2, 4, 5].
sym dif([1, 2, 3, 3], [4, 5, 6, 4]) would return [1, 2, 3, 4, 5, 6].
sym dif([Tom, Jerry], [Jerry, Tom]) would return [ ].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
