Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python set intersection

both = {'a', 'A', 'b', 'B'}
some = {'a', 'b', 'c'}
result1 = both & some
# result: {'a', 'b'}
result2 = both.intersection(some)

print(result1 == result2)
# True
 
PREVIOUS NEXT
Tagged: #python #set #intersection
ADD COMMENT
Topic
Name
5+5 =