Problem with list slice syntax in python
- by Dingle
The extended indexing syntax is mentioned in python's doc.
slice([start], stop[, step])
Slice objects are also generated when extended indexing syntax is used. For example: a[start:stop:step] or a[start:stop, i]. See itertools.islice() for an alternate version that returns an iterator.
a[start:stop:step] works as described. But what about the second one? How is it used?