AI engineering glossary · Python core

What is logical operator?

Logical operator (also called boolean operator): One of the keywords and, or and not, which combine or invert boolean conditions. and is true only if both sides are true, or is true if at least one side is, and not flips the value. They are used to build compound conditions.

Level: beginnerTopic: Python core

Logical operator: an example

age >= 18 and has_id is True only when both hold. not is_empty flips a True into False.

Related terms

More Python core terms

Where you learn it

Logical operator is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.