How to intersect sets in python?
Question:
From for example sets:
a = {'a', 'b', 'c'}
b = {'a', 'd', 'e'}
Get intersection:
c = {'a'}
Answers:
Use intersection method:
c = a.intersection(b)
From for example sets:
a = {'a', 'b', 'c'}
b = {'a', 'd', 'e'}
Get intersection:
c = {'a'}
Use intersection method:
c = a.intersection(b)