Answer: Python Puzzler #2695

The answer is B. The program prints:

True

This answer was checked by running the program for real.

Why?

in checks whether something is in the list. ‘mango’ is in the lunchbox, so the answer is True.

The code again

lunchbox = ["pear", "banana", "grape", "mango"]
print("mango" in lunchbox)

Try it: change one number in the program and predict the new output before you run it.