Table of Associativity and Precedence

This table shows the operators we have encountered so far.

OperationDescriptionAssociativity
()parentheses for groupingleft to right
**exponentiationright to left
+, -unary + (positive sign), unary - (negative sign)left to right
*, /, //, %multiplication, division, remainderleft to right
+, -addition and subtractionleft to right
in, not in, <, <=, >, >=, !=, ==membership and comparisonsleft to right
notboolean notleft to right
andboolean andleft to right
orboolean orleft to right

A PDF version is available here.
ECS 10, Basic Concepts of Computing
Fall Quarter 2012