In [1]: string = "Howdy doody"
In [2]: string[::]
Out[2]: 'Howdy doody'
In [3]: string[::-1]
Out[3]: 'ydood ydwoH'
In [4]: string[0:]
Out[4]: 'Howdy doody'
In [5]: string[0::-1]
Out[5]: 'H' # what up with this?
In [6]: string[:len(string)]
Out[6]: 'Howdy doody'
In [7]: string[:len(string):-1]
Out[7]: '' # what up with this too?
In [8]: string[0:len(string)]
Out[8]: 'Howdy doody'
In [9]: string[0:len(string):-1]
Out[9]: '' # And what up here too.
A slice bracket has three 'slots': Start, end, and step.
[2:17:3] means: Start at 2, end before 17, go in steps of 3.
[17:2:-3] means: Start at 17, end before 2, go *backward* steps of 3.
If you leave slots empty, there's a default.
[:] means: The whole thing.
[::1] means: Start at the beginning, end when it ends, walk in steps of 1 (which is the default, so you don't even need to write it).
[::-1] means: Start at the end (the minus does that for you), end when nothing's left and walk backwards by 1.
string = "Hello World"
#to index the final character of this string we would do
string[-1]
#this is useful when we dont know how long the string is going to be
#for example with user input
string = input("Enter a string: ")
last_character = string[-1]