CodesJava

Easy learning with example program codes

Python Operators

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>>

 

Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status