How to check two sets for intersection in Python

1 Answer

0 votes
s1 = set(["a", "b", "c", "d", "e"])
s2 = set(["b", "e"])
print(s1.intersection(s2))


'''
run:
   
{'b', 'e'}
 
'''

 



answered Jun 27, 2018 by avibootz
...