The method sort() sorts objects of list, in place.
Following is the syntax for sort() method:
list.sort([func])
func -- This is an optional parameter, if given the it would use that function to sort the objects of the list..
This method does not return any value but sort the given object from the list.
The following example shows the usage of sort() method.
#!/usr/bin/python
aList = [123, 'xyz', 'zara', 'abc', 'xyz'];
aList.sort();
print "List : ", aList;
When we run above program, it produces following result:
List : [123, 'abc', 'xyz', 'xyz', 'zara']