---
title: "What is meant by logical operators in python?"  
description: "What is meant by logical operators in python?"  
author: "Amrita Bhattacharjee"  
published: 2023-03-28  
updated: 2023-03-28  
canonical: https://www.mindstick.com/forum/157627/what-is-meant-by-logical-operators-in-python  
category: "python"  
tags: ["python"]  
reading_time: 1 minute  

---

# What is meant by logical operators in python?

What is meant by [logical](https://www.mindstick.com/forum/33581/what-is-inserted-deleted-logical-table-in-sql-server) [operators](https://www.mindstick.com/articles/716/php-operators) in [python](https://www.mindstick.com/articles/75378/simple-yet-useful-tips-when-using-python)?Give suitable example.

## Replies

### Reply by Krishnapriya Rajeev

In Python, logical operators are *symbols or keywords* used to perform logical operations on one or more *boolean* values.

Python has three logical operators:

1. **AND operator**: The AND operator is denoted by and returns True if both the operands are true, otherwise, it returns False.
2. **OR operator**: The OR operator is denoted by or and returns True if any one of the operands is true, otherwise, it returns False.
3. **NOT operator**: The NOT operator is denoted by not and returns True if the operand is false, otherwise, it returns False.

These logical operators are commonly used in *conditional statements, loops,* and *other programming constructs* to perform logical operations on boolean values.

Example:

```plaintext
#AND
x = 3
y = 2
z = 1
if x > y and y > z:
    print("Both conditions are true")
else:
    print("At least one condition is false")

#OUTPUT: Both conditions are true
```


---

Original Source: https://www.mindstick.com/forum/157627/what-is-meant-by-logical-operators-in-python

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
