Introduction to the Basics of Python 3-Part 9
In this short lesson, we cover the important membership operators for the container types in Python. Membership operators are used to seeing whether or not a given element is present in the container one would like to check.
In the example below, we create a list called L with the elements -1,0,1. I check whether or not 0 is in it, and then I check whether the integer 10 is in it. One can check whether or not a specific number is “in” the list L as shown in the first two cells below. Also, it is possible to check whether or not an element is “not in” a…