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