Fill: List Sort
Fill in the Blank Easy
Question
Fill in the blank to sort the list in ascending order.
Code
nums = [3, 1, 4, 1, 5]
nums.___()
Hint
The in-place sorting method is...
Explanation
sort() sorts the list in place (modifies the original list). After nums.sort(), nums is [1, 1, 3, 4, 5]. Use sorted(nums) if you want a new sorted list without modifying the original.
Related Resources
Related Lessons
- Lists
Sorting lists.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.