Python Operators

Python Operators

Operators are special symbols in Python that carry out arithmetic or logical computation. The value that the operator operates on is called the operand.

For example:
>>> 2+3
5
Here, + is the operator that performs addition. 2 and 3 are the operands and 5 is the output of the operation.

Python has a number of operators that are classified below.

Type of operators in Python

Arithmetic operators
+, -, *, /, %, //, **

Comparison (Relational) operators
<, >, <=, >=, ==, !=

Logical (Boolean) operators
and, or, not

Bitwise operators
&, |, ~, ^, >>, <<

Assignment operators
=, +=, -=, /=, *=, %=, //=, **=

Special operators
is, is not, in, in not

Visitor Counter

0142294