how to reverse a string variable in python code example Example: python reverse string 'String'[::-1] #-> 'gnirtS'