Main menu

Pages

Learn Python #3 Comparison operators and Logical operators

Learn Python #3

Comparison operators and Logical operators


 



    Operators are special symbols that designate that some sort of computation should be performed. The values that an operator acts on are called operands.

 The following sections describe:

 - comparison operations in Python.

 - logical operators in Python.

 - as will as some other operators (is, is not, in, not in operators).


Comparison operators:

The following are the comparison operators:

Example:


Logical operators:

Python uses these logical operators:

Example:


is, is not, in, not in operators

    In python we can use other operators like:

Example:



Note: 'Hello' and 'hello' are not the same in this situation (case sensitive).

author-img
Yet another human being that's passionate about Data Science, AI, programming & Math.

Comments