method for ascending order in list python code example
Example 1: list sort python
>>> names = ['Harry', 'Suzy', 'Al', 'Mark']
>>> sorted(names)
['Al', 'Harry', 'Mark', 'Suzy']
>>> sorted(names, reverse=True)
['Suzy', 'Mark', 'Harry', 'Al']
Example 2: sort list in python
List_name.sort()
This will sort the given list in ascending order.