Python Logical Operators or Boolean Operators

Python Logical Operators:

We can use the PyCharm code editor for this example. If you do not know about it then follow this link- How to install PyCharm for Python and create a program in it.

(1) These operators are also called Boolean Operators. With Boolean Operators, we perform logical operations. These are most often used with if and while keywords. These operators are also used to combine one or more than one relational expressions. There are three logical operators supported by Python. These operators (and, or, not) are to be written in lowercase only.

OperatorDescription
andReturns True if both statements are true.
orReturns True if one of the statements is true.
notReverse the result, returns False if the result is true.

(2) Example of and operator.

and operator in python

(3) Example of or operator.

or operator in python

(4) Example of not operator.

not operator in python

Python Relational Operators or Comparison Operators
Python Arithmetic Operators
String Concatenation in Python
Python (programming language)– Wikipedia
Email (Electronic Mail)
FTP (File Transfer Protocol)

Information Security in E-Commerce

Comments (No)

Leave a Reply