Table of Precedence and Associativity

This table shows the precedence and associativity of the arithmetic, relational, and logical operators from highest to lowest precedence.
OperationDescriptionAssociativity
()parentheses for groupingleft to right
**exponentiationright to left
+, -unary + (positive sign), unary - (negative sign) left to right
*, /, //, +, -addition and subtractionleft to right
in, not in, is, is not, <, >, <=, >=, !=, ==  membership and comparisonsleft to right
notboolean notleft to right
andboolean andleft to right
orboolean orleft to right

You can also obtain a PDF version of this. Version of March 29, 2014 at 10:11PM