Answer: Python Puzzler #394

The answer is C. The program prints:

OO
WW
LL
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 2 times in a row.

Trace table

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

letterprinted
OOO
WWW
LLL

The code again

for letter in "OWL":
    print(letter * 2)

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