Visualize this
The best way to remember how slices work is to think of the indices as pointing between characters, with the left edge of the first character numbered 0. Then the right edge of the last character of a string of n characters has index n, for example:
+---+---+---+---+---+
| H | e | l | l | o |
+---+---+---+---+---+
0 1 2 3 4 5
-5 -4 -3 -2 -1
Indices may be negative numbers, to start counting from the right.
But Note that -0 is really the same as 0, so it does not count from the right!
In [105]: "helloworld"[-0]
Out[105]: 'h'
In [106]: "helloworld"[0]
Out[106]: 'h'
i.e. why reverse indexing starts from -1
In [107]: "helloworld"[-1]
Out[107]: 'd'
for getting the second last index of string i.e. [-2] i.e. The last-but-one character
negative stepping is required, the step is added to get to the next index
In [108]: "helloworld"[-1 + -1]
Out[108]: 'l'