In Python, slice notation is used to access a range of elements in an iterable (string, list, tuple, etc.). The general form is:
[start:stop:step]start: Starting index, inclusive. Default to start of string at0if omitted.stop:Stopping index, exclusive. Defaults to end of string at-1if omitted.step:Step/stride. Defaults to1if omitted. Can be negative.
A common idiom for reversing a string would be string[::-1]. This traverses the whole string but backward because of the negative step.