reverse words in a string python using function code example
Example 1: reverse string in python
'hello world'[::-1]
'dlrow olleh'
Example 2: reverse string python
txt = "Hello World"[::-1]
print(txt)
'hello world'[::-1]
'dlrow olleh'
txt = "Hello World"[::-1]
print(txt)