Answer: Python Puzzler #583

The answer is D. The program prints:

Level 5
What the program prints
Checked by running the program for real.

Why?

Python works out level + 3 first, which is 5. str() turns the number into text so it can be joined onto “Level “.

The code again

level = 2
print("Level " + str(level + 3))

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