Question: in python only The intersection () of two sets (s1, s2) is the set of all elements that are in s1 and are also in

in python only

The intersection () of two sets (s1, s2) is the set of all elements that are in s1 and are also in s2.

. Write a function (intersect) that takes two lists as input (you can assume they have no duplicate elements), and returns the intersection of those two sets (as a list) without using th ein operator or any built-infunctions, except for range() and len()

. Write some code to test your function, as well.

Sample Output:

>>> intersect([1,3,5,7,9,11,13,15,17,19,21,23,25],[1,4,9,16,25])[1, 9, 25]

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!