There is an example of reverse slicing that I saw in the course:
At line 3 it said
print(my_string[17:0:-2])
I thought the outcome would be
git Ms it
because:
- the substring has 18 characters
- so when we type “[17:0:-2]” it means the substring ends before “!”
but the result was actually
!nrsY ish
can sb explain why? sorry for my bad english