
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
What is correct operators precedence in Python?
Following table shows order of precedence of operators in Python starting from highest to lowest precedence.
** : Exponentiation (raise to the power) | |
~ + - : Ccomplement, unary plus and minus (method names for the last two are +@ and -@) | |
* / % // : Multiply, divide, modulo and floor division | |
+ - : Addition and subtraction | |
>> << : Right and left bitwise shift | |
& : Bitwise 'AND' | |
^ | : Bitwise exclusive `OR' and regular `OR' | |
<= < > >= : Comparison operators | |
<> == != : Equality operators | |
= %= /= //= -= += *= **= : Assignment operators | |
is is not : Identity operators | |
in not in : Membership operators | |
not or and : Logical operators |
- Related Articles
- Python Operators Precedence
- Operators Precedence in C++
- Java Operators Precedence
- Perl Operators Precedence
- C++ Operators with Precedence and Associativity
- What is Operator Precedence Parsing?
- What is the operator precedence in C#?
- What is difference in Python operators != and "is not"?
- What is behavior of ++ and -- operators in Python?
- What is different in & and AND operators in Python?
- What is different in | and OR operators in Python?
- What is the difference between = and == operators in Python?
- What is different in OR and AND operators in Python?
- What is C Operator Precedence and Associativity?
- What are boolean operators in Python?

Advertisements