← All PCEP Flashcard Decks

Operator Precedence and Binding Flashcards

7 cards from real PCEP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Operator Precedence and Binding flashcards as text
  1. What is the result of `2 + 3 * 4 - 1`?

    Answer: 13

    Multiplication is evaluated first (3*4=12), then left-to-right addition and subtraction: 2+12-1=13.

  2. Which operator has the highest precedence in Python?

    Answer: **

    The exponentiation operator `**` has the highest precedence among arithmetic operators in Python.

  3. What does `True or False and False` evaluate to?

    Answer: True

    `and` has higher precedence than `or`, so `False and False` is evaluated first (False), then `True or False` equals True.

  4. What is the result of `10 // 3 + 1`?

    Answer: 4

    Floor division `//` has the same precedence as `*` and `/`, so `10//3=3`, then `3+1=4`.

  5. How does Python evaluate `not True and False`?

    Answer: False

    `not` has higher precedence than `and`, so `not True` evaluates to False first, then `False and False` equals False.

  6. What is the value of `3 ** 2 ** 2`?

    Answer: 81

    The `**` operator is right-associative, so `2**2=4` is evaluated first, then `3**4=81`.

  7. What does `4 + 2 > 3 * 2` evaluate to?

    Answer: True

    Arithmetic operators have higher precedence than comparison operators: `4+2=6` and `3*2=6`, then `6>6` is False — wait, 6>6 is False.