AI engineering glossary · Python core
What is operator precedence?
Operator precedence (also called order of operations): The fixed order in which Python evaluates operators when an expression has several. Exponentiation comes first, then multiplication and division, then addition and subtraction, then comparisons, then not, and, or. Parentheses override the order.
Operator precedence: an example
2 + 3 * 4 gives 14, not 20, because * binds tighter than +. (2 + 3) * 4 gives 20.
Related terms
More Python core terms
Where you learn it
Operator precedence is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.