Lists - Advanced Features

Lists can be 'sliced' using indexing and the colon. This produces a sub-list.
Slicing can also be applied to strings.

>>> a = [1, 2, 3, 4, 5, 6, 7]
>>> a[3:6]
[4, 5, 6]

Other functions that exist for lists are: append, sort, reverse, index, and the global function len.

>>> b = [3, 7, 2, 1]
>>> b.sort()
>>> b
[1, 2, 3, 7]
>>> b.index(3)
2
>>> len(b)
4