Python Operators in general are used to perform operations on values and
variables. Operators are the pillars of a program on which the logic is built in a
specific programming language. Python provides a variety of operators, which are
described as follows.
o Arithmetic operators
o Comparison operators
o Assignment Operators
o Logical Operators
o Bitwise Operators
o Membership Operators
o Identity Operators
Arithmetic operators
Arithmetic operators are used with numeric values to perform common
mathematical operations.
Operator Description Syntax
+ Addition: adds two operands x+y
– Subtraction: subtracts two operands x–y
* Multiplication: multiplies two operands x*y
/ Division (float): divides the first operand by the second x/y
Division (floor): divides the first operand by the
// second x // y
Modulus: returns the remainder when the first operand
% is divided by the second x%y
** Power: Returns first raised to power second x ** y