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