I want to reverse a string using slicing and initially I tried
string = "abcdef"
print(string[len(string) - 1: 0: -1])
However this only prints up to the index 1
fedcb
So, I decided to change the slicing by changing the ending index of the slicing to -1
string = "abcdef"
print(string[len(string) - 1: -1: -1])
I'm assuming this will print up to index 0. But this did not print any characters of the string upon running. My question is why doesn't this work?