This syntax works for any interable, not just lists. It just returns a new reversed list, but it doesn't modify the original one.
L=[
0, 10, 20, 40]L[::-1]
[40, 20, 10, 0]
The syntax represanted as [start:stop:step], so step is -1. You're only returning the values in reverse
To actually reverse the list,
L=L[::-1]
Ref:
https://docs.python.org/release/2.3.5/whatsnew/section-slices.html
http://stackoverflow.com/questions/3940128/how-can-i-reverse-a-list-in-python
Ref:
https://docs.python.org/release/2.3.5/whatsnew/section-slices.html
http://stackoverflow.com/questions/3940128/how-can-i-reverse-a-list-in-python