Now you know how to perform membership tests using Python’s in
and not in
operators. This type of test allows you to check if a given value is present in a collection of values, which is a pretty common operation in programming.
In this video course, you’ve learned how to:
- Run membership tests using Python’s
in
andnot in
operators - Use the
in
andnot in
operators with different data types - Work with
operator.contains()
, the equivalent function to thein
operator - Support
in
andnot in
in your own classes
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.