Extended slices in Python
To access even-indexed elements of a list, use the extended slice feature of Python.
>>> range(20)[::2]
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
This can be used to access every third element by using ::3 and so on.
To reverse a list, use the extended slice with an argument of -1.
>>> range(8)[::-1]
[7, 6, 5, 4, 3, 2, 1, 0]