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:
| Operator | Description | Example | Try it |
|---|---|---|---|
| and | Returns True if both statements are true | x < 5 and x < 10 | Try it » |
| or | Returns True if one of the statements is true | x < 5 or x < 4 | Try it » |
| not | Reverse the result, returns False if the result is true | not(x < 5 and x < 10) | Try it » |
Examples
python
python
python
Module quiz
Test your knowledge on this module
2 questions