How to intersect sets in python?

Question:

From for example sets:

a = {'a', 'b', 'c'}
b = {'a', 'd', 'e'}

Get intersection:

c = {'a'}
Asked By: eresque-

||

Answers:

Use intersection method:

c = a.intersection(b)
Answered By: John Doe
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.