how to reverse a section of string in python code example
Example 1: reverse string in python
'hello world'[::-1]
'dlrow olleh'
Example 2: how to reverse string in python
txt = "Hello World"[::-1]
print(txt)
'hello world'[::-1]
'dlrow olleh'
txt = "Hello World"[::-1]
print(txt)