Answer: Python Puzzler #3179

The answer is B. The program prints:

[6, 18, 23, 30, 39, 42]

This answer was checked by running the program for real.

Why?

sort() puts the list in order, smallest first. It changes the list itself.

The code again

scores = [30, 42, 6, 39, 23, 18]
scores.sort()
print(scores)

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