I\'m slicing lists in python and can\'t explain some results. Both of the following seem natural to me:
>>>[0,1,2,3,4,5][1:4:1] [1, 2, 3] >>>
The third number in the slice is the step count. So, in [0,1,2,3,4,5][1:4:-1], the slicing starts at 1 and goes DOWN by 1 until it is less than 4, which is immediately is. Try doing this:
[0,1,2,3,4,5][1:4:-1]
1
4
>>> [0,1,2,3,4,5][4:1:-1] [4, 3, 2]