Inbuilt Python Sort Functions
Apart from above popular sorting algorithms, we can also use python’s inbuilt sort functions to sort a list.
Python have inbuilt method sort() to sort the list.
Above code sort the list in ascending order. If you want to sort the list in descending order then we can set reverse parameter to True as follows:
Moreover, Python have inbuilt function sorted() which creates a new sorted list.
Same way, if we want to create new sorted list in descending order then we can set reverse parameter of sorted function to True as follows: