I want to print the part of the text in reverse order. Help, why is my code not working?
s = 'abch12345h'
print(s[3:9:-1])
Since your stepping backwards your starting and ending index needs to switch place like this
print(s[9:3:-1])
>>> h54321
Here's a good related answer: Understanding slicing
Done! If the stride is negative, then the start index must be more than the end index. Is will work:
print(s[9:3:-1])