Membership tests

Finally, as with most collection types in Python, we can test for membership using the in operator:

>>>  5 in (3, 5, 17, 257, 65537)
True

Also non-membership with the not in operator:

>>> 5 not in (3, 5, 17, 257, 65537)
False

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset