Question: Python Program Create a function inter(list1, list2) that takes in two lists, makes them sets, and returns their intersection. inter([1, 1, 2, 3, 5], [1,

Python Program

Create a function inter(list1, list2) that takes in two lists, makes them sets, and returns their intersection.

inter([1, 1, 2, 3, 5], [1, 1, 4, 5, 5]) should return [1, 5]

inter([4, 5, 5, 4], [1, 2, 3, 1]) should return [ ] inter([3, 4, 5], [4, 4, 3, 5]) should return [3, 4, 5]

Do the same for union(list1, list2) that returns their union.

union([1,1,2,3], [3, 3, 3, 4]) should return [1, 2, 3, 4]

union([1, 3], [Tom]) should return [1, 3, Tom]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!