The Python Language Reference, Release 3.9.5 6.16. Evaluation order 81 The following table summarizes the operator precedence in Python, from highest precedence (most binding) to lowest precedence (least binding). Operators in the same box have the same precedence. Unless the syntax is explicitly given, operators are binary. Operators in the same box group left to right (except for exponentiation, which groups from right to left). Note that comparisons, membership tests, and identity tests, all have the same precedence and have a left-to-right chaining feature as described in the Comparisons section. Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side. In the following lines, expressions will be evaluated in the arithmetic order of their suffixes: The trailing comma is required only to create a single tuple (a.k.a. a singleton ); it is optional in all other cases. A single expression without a trailing comma doesn’t create a tuple, but rather yields the value of that expression. (To create an empty tuple, use an empty pair of parentheses:$_{()}$ .) An asterisk$_{*}$denotes iterable unpacking . Its operand must be an iterable . The iterable is expanded into a sequence of items, which are included in the new tuple, list, or set, at the site of the unpacking. Except when part of a list or set display, an expression list containing at least one comma yields a tuple. The length of the tuple is the number of expressions in the list. The expressions are evaluated from left to right. 6.15 Expression lists 6.16 Evaluation order 6.17 Operator precedence expr1, expr2, expr3, expr4 (expr1, expr2, expr3, expr4) {expr1: expr2, expr3: expr4} expr1+expr2*(expr3-expr4) expr1(expr2, expr3, *expr4,**expr5) expr3, expr4 =expr1, expr2 expression_list ::= expression ("," expression )* [","] starred_list ::= starred_item ("," starred_item )* [","] starred_expression ::= expression | ( starred_item ",")* [ starred_item ] starred_item ::= assignment_expression | "*" or_expr New in version 3.5: Iterable unpacking in expression lists, originally proposed by PEP 448 .