Answer: Python Puzzler #311

The answer is B. The program prints:

gadget gadget gadget 
What the program prints
Checked by running the program for real.

Why?

Multiplying a string by a number repeats it. * 3 makes 3 copies, joined together with nothing in between (the ‘ ‘ is part of each copy).

The code again

word = "gadget"
print((word + " ") * 3)

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