List sort() Method

In Python Built-In List sort() method is used to sort objects of given list, and use compare func if given.

Syntax:
No Parameter is used in list sort() method.
Example:
#method

list1 = ['TOM', 'ALICE', 'BOB']
print ("List before sorting : ", list1)
list1.sort();
print ("List after sorting : ", list1)