sort vs. sorted
The sort() method will sort a list in-place and return None. The built-in sorted() function will return the sorted list and leave the original list intact.
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
The sort() method will sort a list in-place and return None. The built-in sorted() function will return the sorted list and leave the original list intact.