Operators in Python
The operators are a character or symbol to performs operation on variable and value. It performs operation and return generated value. It can be assigned to either variable or it can be return from the function.

Operators

1. Arithmetic2. Assignment3. Relational4. Logical5. Identity6. Membership7. Bitwise8. Shift

Arithmetic

The arithmetic operators performs basic arithmetic operations for the given variable or value, Arithmetic operation requires minimum two variables or values (operand) to perform operation. It returns the value by performing operation. As it requires minimum two operand that also known as binary operators.
1. Addition2. Subtraction3. Multiplication4. Division5. Modulus6. Exponential7. Floor Division

Assignment

An assignment operator assigned value to the variable. It requires two operands which assign right side operand or expression value to the left side operand. There are many variation or overloaded assignment operators which can be used to perform operation.

Relational

A relational operator used to compare two operand using specified relational operator. If relational operator return boolean value either True if condition is True, otherwise False if condition is False.
1. Double equal operator (==)2. Not equal (!=)3. Greater than (>)4. Less than (<)5. Greater than or equal(>=)6. Less than or equal (<=)

Logical

A logical operator used to connect two or more expressions such that the value of the compound expression produce a result depends on the original expressions specified using logical operator.
1. Logical and2. Logical or3. Logical not

Identity

The identity operators are used to compare the objects whether the specified objects or variables are equal (reference same objects). It returns boolean value either True or False.
1. is2. is not

Membership

The membership operators used to determine whether specified value present in the sequence object. It returns a boolean value True, if specified value present in the object, otherwise False.
1. in2. not in

Bitwise

A bitwise operation operates on a bit string which perform operation at the level of its individual bits. A bitwise operation directly perform by the processor. hence, it executes very fast compare to arithmetic operation.
1. Bitwise AND (&)2. Bitwise OR (|)3. Bitwise XOR (^)4. Bitwise NOT (~)

Shift

The shift operators are used to shifting the bits of a number left or right, thereby multiplying or dividing the number. There are two different types of shift operators, namely left shift operator(<<), signed right operator(>>) available in python.
1. Left shift2. Right shift
Privacy Policy
Terms of Service
Disclaimer
Contact us
About us