The end index of a list slice is a position greater than the start index, is not the size of the slice! so you want something like this:
item[17:len(item)]
Notice that this is exactly equivalent to the previous snippet:
item[17:]
The start and end indexes of a slice such as alist[a:b]
should be interpreted like this: the slice starts at the item in the a
position in alist
and ends one element before the b
position in alist
. Both a
and b
are indexes in alist
.