Table of Contents
Python list sort() function is used to sort a list in ascending, descending or user defined order.
To sort the list in ascending order
This function is used to sort list of integers, floating point number, string and others.
Output
Example 2:
Output
To sort the list in descending order
Example:
Output
Sorting user using user defined order
Example
Output