how to reverse a s substring in python code example Example: how to reverse string in python txt = "Hello World"[::-1] print(txt)