Membership is a fundamental operation for sets, and as with the other collection types is performed using the in and not in operators:
>>> q = { 2, 9, 6, 4 }
>>> 3 in q
False
>>> 3 not in q
True
Membership is a fundamental operation for sets, and as with the other collection types is performed using the in and not in operators:
>>> q = { 2, 9, 6, 4 }
>>> 3 in q
False
>>> 3 not in q
True