The correct answer is: B. Associativity
Precedence is the order in which operators are evaluated in an expression. Associativity is the order in which operands are grouped together when evaluating an expression with multiple operators of the same precedence.
For example, in the expression $a + b – c$, the addition and subtraction operators have the same precedence. The associativity of addition is left-to-right, so $a$ and $b$ are added first, and then the result is subtracted from $c$.
In the expression $a * (b + c)$, the multiplication and addition operators have the same precedence. The associativity of multiplication is right-to-left, so $b$ and $c$ are added first, and then the result is multiplied by $a$.
Here is a table of the precedence and associativity of the most common operators in Python:
| Operator | Precedence | Associativity |
|—|—|—|
| + | 1 | left-to-right |
| – | 1 | left-to-right |
| * | 2 | left-to-right |
| / | 2 | left-to-right |
| % | 2 | left-to-right |
| ** | 3 | left-to-right |
| < | 4 | left-to-right |
| > | 4 | left-to-right |
| <= | 4 | left-to-right |
| >= | 4 | left-to-right |
| == | 5 | left-to-right |
| != | 5 | left-to-right |
| and | 6 | left-to-right |
| or | 6 | left-to-right |
| not | 7 | left-to-right |
| ( ) | 8 | none |
| [] | 9 | none |
| {} | 10 | none |
If an expression contains more than one operator with the same precedence, the order in which they are evaluated is determined by their associativity.