Blog Details

img
Data Science

What are operators in Python

Spoke Right / 16 Nov, 2023

Python Operators:

Python Operators are used to perform operations on operands. Operands can be a variable or a constant. The operators are divided into seven groups on the basis of the basic operations they perform.

Arithmetic Operators:

The operators which are used to perform the arithmetical operations, are grouped together as Arithmetic operators.

OperatorsSymbol
Addition+
Subtraction
Multiplication*
Division/
Modulus%
Exponentiation**
Floor Division//


Assignment Operators:

The operators which are used to assign values to a variable, are grouped together as Assignment operators.

OperatorsSymbol
Equals To=
Added Value+=
Subtracted Value-=
Multiplicated Value*=
Divided Value/=
Modulus Value%=
Exponent and assign**=
Floor division and assign//=


Comparison Operators:

The operators which are used to compare two values, are grouped together as Comparison operators.

OperatorsSymbol
Equal==
Not equal!=
Greater than>
Less than<
Greater than or equal to>=
Less than or equal to<=


Identity Operators:

The operators which are used to compare the same object, with the same memory location, are grouped together as Identity operators.

OperatorsSymbol
 Identicalis
Not Identicalis not


Logical Operators:

The operators which are used to perform logical operations, are grouped together as Logical operators.

OperatorsSymbol
ANDand
ORor
NOTnot


Membership Operators:

The operators which are used to check if a sequence is present in an object, are grouped together as Membership operators.

OperatorsSymbol
Memberin
Not a Membernot in


Bitwise Operators:

The operators which are used to perform Bitwise operations, are grouped together as Bitwise operators.

OperatorsSymbol
AND&
OR|
XOR^
NOT~
Zero fill left shift<<
Signed right shift>>

0 comments

Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0