practicepython.in
python exercises
171 exercises

Daily #2 · 30 September 2026

Sorted, and yet Easy

What does this print?

scores = [42, 7, 19]
result = scores.sort()
print(result)
  1. Araises AttributeError
  2. BNone
  3. C[7, 19, 42]
  4. D[42, 7, 19]
Show the answer

B: None

Why: list.sort() sorts the list in place and returns None, on purpose, so you cannot mistake it for a copy. sorted(scores) returns a new list and leaves the original alone.

Play today’s puzzle →