Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started