Page 151 - Beginning Programming with Pyth - John Paul Mueller
P. 151
multiplication does. Table 7-9 defines the order of operator precedence for Python.
TABLE 7-9 Python Operator Precedence
Operator
()
**
~+-
*/% //
+-
>> <<
&
^|
<= < > >=
== !=
= %= /= //= -= += *=
Description
You use parentheses to group expressions and to override the default precedence so that you can force an operation of lower precedence (such as addition) to take precedence over an operation of higher precedence (such as multiplication).
Exponentiation raises the value of the left operand to the power of the right operand.
Unary operators interact with a single variable or expression.
Multiply, divide, modulo, and floor division.
Addition and subtraction.
Right and left bitwise shift.
Bitwise AND.
Bitwise exclusive OR and standard OR.
Comparison operators.
Equality operators.
Assignment operators.