How does work this pythonic trick: a[::-1]
python
Solution
The third argument is a step modifier. In this case you are using a step of `-1`.
You could also use a step of `2` to print every even index.
>>> a = range(10)
>>> a[::2]
[0, 2, 4, 6, 8]
>>> a[::-2]
[9, 7, 5, 3, 1]
Problem
``` >> a = range(10) >> print a[::-1] [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] ``` This slice gives reversed list. How does it work?