What is the syntax to sort a list?

<list name>.sort()
#example
>>> nums = [2,5,1,4,3]
>>> letters = ['A','E','C','D','B']

>>> nums.sort()
>>> nums
[1, 2, 3, 4, 5]

>>> letters.sort()
>>> letters
['A', 'B', 'C', 'D', 'E']

 

Advertisements