DEV Community

Cover image for Membership Operators in python
Aswin Barath
Aswin Barath

Posted on • Updated on

 

Membership Operators in python

Membership operators are used to testing if a sequence with the specified value is present in the given object.

Fact: In python, all data types are implemented as an object.

Let's go code through each of them.

in operator

Alt Text
Output:

True
Enter fullscreen mode Exit fullscreen mode

not in operator

Alt Text
Output:

True
Enter fullscreen mode Exit fullscreen mode

Code along and have fun ;)

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git