DEV Community

Cover image for Membership Operators in python
Aswin Barath
Aswin Barath

Posted on • Edited on

3 2 1 1 1

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

Best Resources

Who Am I?

I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through Blogging during the busy time of my freelancing work life. Here’s the link to all of my socials categorized by platforms under one place: https://linktr.ee/AswinBarath

Thank you so much for reading my blog🙂.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay