← Quiz: Sorting, heapq and bisect: all 10 questions
Quiz: Sorting, heapq and bisect · Question 2 of 10
What does it mean that Python's sort is stable?
What does it mean that Python's sort is stable?
- A.It never raises an error
- B.It always takes O(n) time
- C.Items with equal keys keep the order they had before sorting
- D.It sorts the list in place
Answer & explanation
Correct answer: Items with equal keys keep the order they had before sorting
Stability is what makes sorting in several passes work.
Can you get the rest right without peeking?
Take the timed Quiz: Sorting, heapq and bisect quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →