PRACTICE / UNDERSTAND / REPEAT

Python: Collections

Practice collections with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

16 questionsAnswers explainedFree · no login
Question 1 of 16
Collections · MCQQuestion link ↗

What does `list.sort()` return?

Choose one answer
Answer & explanation

Answer: None; it sorts the list in place

`list.sort()` mutates the list and returns `None`; `sorted(iterable)` returns a new list.