reverse a substring in python code example
Example 1: reverse string in python
'hello world'[::-1]
'dlrow olleh'
Example 2: reverse the string in python
g = "My name is IRONMAN" #reverse the string
print(str(g[::-1]))
'hello world'[::-1]
'dlrow olleh'
g = "My name is IRONMAN" #reverse the string
print(str(g[::-1]))