Question: Q 2 . Write a program that defines two lists as variables and computes the intersection of these two lists ( i . e .

Q2. Write a program that defines two lists as variables and computes the intersection of these
two lists (i.e., a list of elements that are common to both lists).
Run the following test cases and make sure your results are correct:
Ist1=[1,3,5], Ist2=[5,3,1] The output should be 1,3,5
Ist1=[1,3,6,9], lst2=[10,14,3,72,9] The output should be 3,9
Ist1=[2,3], Ist2=[3,3,3,2,10] The output should be 3,2
Ist1=[2,4,6], Ist2=[1,3,5] The output should be []
N.B.: The order of your outputs does not matter 3,2 is the same as 2,3
 Q2. Write a program that defines two lists as variables and

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!