DEV Community

Cover image for Logical Operators in python
Aswin Barath
Aswin Barath

Posted on • Edited on

2 1 1 1 1

Logical Operators in python

Logical operators are used to combining more than two conditional statements.

These operators are very useful for writing logical conditions in control flow statements of a programming language.

Let's code them one by one.

and operator

  • and operator return the boolean value True only if both statements are true. Alt Text Output:
True
Enter fullscreen mode Exit fullscreen mode

or operator

  • or operator returns the boolean value True if any statement is true. Alt Text Output:
True
Enter fullscreen mode Exit fullscreen mode

not operator

  • not-operator acts as a unary operator which returns the boolean value True the statement is true and vice versa. Alt Text Output:
False
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🙂.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

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

Okay