![Notepad ++ sort alphabetically](https://cdn3.cdnme.se/5447227/9-3/screenshot_3_64e629479606ee7f889a24a8.jpg)
By default, it sorts the list in ascending order. The function sorted() is used to sort a list in Python. Use the itemgetter() Function From the Operator Module Along With the sorted() Function to Sort a List of Lists in Python
![notepad ++ sort alphabetically notepad ++ sort alphabetically](https://tutorial.eyehunts.com/wp-content/uploads/2021/07/214185683_4112660115449502_7729150927702586256_n.jpg)
In this tutorial, we will sort a list of lists in Python based on some indexes. Sorting a list of lists arranges all the inner lists according to the specified index as the key.
![notepad ++ sort alphabetically notepad ++ sort alphabetically](https://cdn.shopify.com/s/files/1/0270/6092/8645/collections/Subaru-Crosstrek-Hitch-Spare-Tire-Carrier-01_1200x1200.jpg)
These can be thought of as a list of lists. We can sort a list in Python by arranging all its elements in ascending or descending order based on the requirement.
![Notepad ++ sort alphabetically](https://cdn3.cdnme.se/5447227/9-3/screenshot_3_64e629479606ee7f889a24a8.jpg)