The sort method is used to sort lists in place. : Sort « List « Python Tutorial






x = [4, 6, 2, 1, 7, 9]
x.sort()
print x








7.24.Sort
7.24.1.The sort method is used to sort lists in place.
7.24.2.sort the elements according to their lengths
7.24.3.the list should be sorted in reverse:
7.24.4.Sorting a List
7.24.5.Key sort
7.24.6.Reverse sort