Let's take a string variable named as str1. The syntax that you are referring to is known as Slice notation in Python-
list[<start>:<stop>:<step>]
So, when you write:
[::-1]
It will begin from the end towards the first extracting each element. So it will reverse a. This is applicable for lists/tuples as well.
Say for instance:
>>> a = '1234'
>>> a[::-1]
'4321'