return list slice python code example
Example 1: is : and :: the same in python slice
a[-1] # last item in the array
a[-2:] # last two items in the array
a[:-2] # everything except the last two items
Example 2: python array slice
>>> a[1:4]
[2, 3, 4]