Refer to the exhibit. What is the output when the code is executed?
The loop rebinds the same variable each iteration, and the final assignment leaves it holding 2. Printing after the loop completes therefore emits 2 2 2, because all three print calls reference the variable's last value rather than capturing each iteration's value separately.
Why this answer
The code defines a tuple `t = (0, 1, 2)`. The `for` loop iterates over the tuple, but each iteration prints `t[2]`, which is the third element (index 2) with value 2. Since the value is constant, it prints '2' three times.
Hence the output is '2 2 2'.
Exam trap
The trap is that candidates might assume the loop prints each element of the tuple (0, 1, 2) sequentially, but the code prints the element at index 2 (the third element) each time, resulting in three copies of 2.
How to eliminate wrong answers
Option A is wrong because it assumes the loop prints the current element `x` (0, 1, 2) rather than the fixed index `t[0]`. Option B is wrong because it assumes `t[0]` changes during iteration or that the tuple is modified, but tuples are immutable and `t[0]` remains `2`. Option D is wrong because it assumes the loop runs three times and prints `t[0]` but mistakenly thinks `t[0]` is `3`, which is not an element of the tuple.