Answer: Python Puzzler #384

The answer is C. The program prints:

RRR
OOO
BBB
OOO
TTT
What the program prints
Checked by running the program for real.

Why?

A for loop can go through a string one letter at a time. Each letter is printed 3 times in a row.

Trace table

A trace table follows the program step by step. Here’s this one:

letterprinted
RRRR
OOOO
BBBB
OOOO
TTTT

The code again

for letter in "ROBOT":
    print(letter * 3)

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