Intersection of several sets
Write a Python program to find the items shared by several sets.
{1, 2, 3}, {2, 3, 4}, {3, 4, 5}{3}Approach
set.intersection(*sets).
Solution
sets = [{1, 2, 3}, {2, 3, 4}, {3, 4, 5}]print(set.intersection(*sets)){3}Learn the concept
New to this topic? Read the lesson, then come back.