Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Checking for Membership Using "in" and "not in" Operators (Summary)

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 and not in operators
  • Use the in and not in operators with different data types
  • Work with operator.contains(), the equivalent function to the in operator
  • Support in and not in in your own classes
Download

Course Slides (.pdf)

9.3 MB
Download

Sample Code (.zip)

2.1 KB

Become a Member to join the conversation.