Why does sequence[1:0]
return an empty list when sequence[1:]
or sequence[1:n] (where n >= sequence length)
returns the tail of the list successfully?
I'm pretty sure it's to do with the way that python iterates over the loop, but I can't fathom why it wouldn't work, considering it works for numbers less than zero.
Example:
>>> l = [1,2,3,4]
>>> l[1:]
[2,3,4]
>>> l[1:100]
[2,3,4]
>>> l[1:0]
[]
>>> l[1:0:1]
[]
>>> l[1:-2]
[2]