Python Tutorials · Python Operators

Logical Operators

Learn all about Logical Operators in this comprehensive tutorial.

5 min read beginner
  • Logical operators are used to combine conditional statements:

Logical Operators

Logical operators are used to combine conditional statements:

OperatorDescriptionExampleTry it
andReturns True if both statements are truex < 5 and  x < 10Try it »
orReturns True if one of the statements is truex < 5 or x < 4Try it »
notReverse the result, returns False if the result is truenot(x < 5 and x < 10)Try it »

Examples

python
python
python

Module quiz

2 questions
1

Which of the following is true about Logical Operators?

2

What is the most common pitfall when working with Logical Operators?

Answer all questions to submit.