DEV Community

loading...
Cover image for Membership Operators in python

Membership Operators in python

aswin2001barath profile image Aswin Barath Updated on ・1 min read

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 ;)

Discussion (0)

pic
Editor guide