in the following example:
foo = [\'red\', \'white\', \'blue\', 1, 2, 3]
where: foo[0:6:1]
will print all elements in foo. Howe
This answer might be a little outdated, but it could be helpful for someone who stuck with same problem. You can get reverse list with an arbitrary end - up to 0 index, applying second in-place slice like this:
>>> L = list(range(10))
>>> L
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> (start_ex, end) = (7, 0)
>>> L[end:start_ex][::-1]
[6, 5, 4, 3, 2, 1, 0]
You can get it to work if you use a negative stop value. Try this:
foo[-1:-7:-1]