This article covers the procedure on how to reverse a string in Python. Strings can be reversed using slicing. To reverse a string, we simply create a slice that starts with the length of the string, and ends at index 0.
To reverse a string using slicing, write:
$ stringname[stringlength::-1] # method 1
Or write without specifying the length of the string:
$ stringname[::-1] # method2
The slice statement means start at string length, end at position 0, move with the step -1 (or one step backward).