Precedence of Python Operators
Python operators are evaluated according to a
set order or priority:
|
Description
|
Operators
|
|
|
|
1
|
Exponentiation
|
**
|
|
|
|
|
Ccomplement,
unary plus,
|
~, +, -
|
2
|
and minus
|
|
|
|
|
|
Multiplication,
division,
|
*, /, %, //
|
3
|
modulo, and
floor division
|
|
|
|
|
4
|
addition and
subtraction
|
+ -
|
|
|
|
5
|
Right and left
bitwise shift
|
>>,
<<
|
|
|
|
6
|
Bitwise ‘AND’
|
&
|
|
|
|
|
Regular `OR’
and Bitwise
|
|, ^
|
7
|
exclusive ‘OR’
|
|
|
|
|
8
|
Comparison
operators
|
<= < >
>=
|
|
|
|
9
|
Equality
operators
|
== !=
|
|
|
|
10
|
Assignment
operators
|
=, +=, -=, *-,
/=, %= //= **=
|
|
|
|
11
|
Identity
operators
|
is, is not
|
|
|
|
12
|
Membership
operators
|
in, not in
|
|
|
|
13
|
Logical
operators
|
or, and, not
|
|
|
|
Great Article
ReplyDeleteData Mining Projects
Python Training in Chennai
Project Centers in Chennai
Python Training in Chennai