Intersection of two sets
Write a Python program to find the intersection of two sets.
{1, 2, 3, 4}, {3, 4, 5}{3, 4} {3, 4}Approach
&orintersection().
Solution
a, b = {1, 2, 3, 4}, {3, 4, 5}print(a & b, a.intersection(b)){3, 4} {3, 4}Learn the concept
New to this topic? Read the lesson, then come back.