The answer is B. The program prints:
apple
This answer was checked by running the program for real.
Why?
Python counts list positions from 0, so position 3 is the fourth item.
Trace table
A trace table follows the program step by step. Here’s this one:
| position | negative position | item |
|---|---|---|
| 0 | -6 | plum |
| 1 | -5 | pear |
| 2 | -4 | mango |
| 3 | -3 | apple |
| 4 | -2 | grape |
| 5 | -1 | banana |
The code again
basket = ["plum", "pear", "mango", "apple", "grape", "banana"]
print(basket[3])
Try it: change one number in the program and predict the new output before you run it.