I understand that when slicing strings, the first index number refers to the start (inclusive), second number refers to end (exclusive) and the third refers to step size. So, wouldn't the first example throw an index error since length 6 is outside of the string? In the second example I would've expected "nohty" and "ohty" for the third example but this is clearly not the case.
temp = 'Python'
stringLen = len(temp)
slicedStr = temp[stringLen::-1]
print(slicedStr)
>>> nohtyP
stringLen = len(temp) - 1
slicedStr = temp[stringLen::-1]
print(slicedStr)
>>> nohtyP
stringLen = len(temp) - 2
slicedStr = temp[stringLen::-1]
print(slicedStr)
>>> ohtyP