25 July 2010

Python Sorting basics

sort() function is a list class method and modify/sorts a list in-place; sorted() function is a python built-in function that builds a new sorted list from an iterable and return that new-built list.

Most of the time, you actually want sorted function to do the job for you.

No comments: