
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Python Logical Operators
There are following logical operators supported by Python language. Assume variable a holds 10 and variable b holds 20 then −
Sr.No | Operator & Description | Example |
---|---|---|
1 | and Logical AND If both the operands are true then condition becomes true. | (a and b) is true. |
2 | or Logical OR If any of the two operands are non-zero then condition becomes true. | (a or b) is true. |
3 | not Logical NOT Used to reverse the logical state of its operand. | Not(a and b) is false. |
- Related Articles
- Logical Operators on String in Python?
- Java Logical Operators
- Perl Logical Operators
- Logical Operators in C++
- Java Regular expressions Logical operators
- Relational and Logical Operators in C
- What are Logical Operators in JavaScript?
- Logical Operators on String in C#
- Logical Operators on String in Java
- Explain the logical operators in DBMS
- Written version of Logical operators in C++
- What are the logical operators in Java?
- What are the logical operators in C#?
- What types of logical operators are in javascript?
- How can we use logical operators while creating MySQL views?

Advertisements