reverse string using slicing in python 3 code example Example 1: python reverse string 'String'[::-1] #-> 'gnirtS' Example 2: python 3 slice reverse stringname[::-1]