- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Boolean Operations
The basic Boolean operations are and, or, not operations.
The and operation − The basic syntax of and operation is: x and y. It indicates that when the x is false, then return x, otherwise returns y.
The or operation −The basic syntax of or operation is: x or y. It indicates that when the x is false, then return y, otherwise returns x.
The not operation − The basic syntax of and operation is: not x. It indicates that when the x is false, then it returns true, otherwise it returns false.
x = 25 y = 18 or_op = x or y print(or_op) and_op = x and y print(and_op) not_op = not x print(not_op) x = 0 not_op = not x print(not_op)
25 18 False True
- Boolean Indexing in Python
- Boolean Values in Python
- Python - Contiguous Boolean Range
- String Operations in Python
- Boolean list initialization in Python
- What are boolean operators in Python?
- Parsing A Boolean Expression in Python
- Common string operations in Python
- Basic List Operations in Python
- Basic Tuples Operations in Python
- Python Shallow and Deep Copy operations
- Arithmetic operations using OpenCV in Python
- Convert Java Boolean Primitive to Boolean object
- Write a Pyton program to perform Boolean logical AND, OR, Ex-OR operations for a given series
- Java Program to convert boolean value to Boolean