Following is the easiest way of reversing a string in python:
string = 'SHWETA'
print(string[: : -1])
I just wanted to know if this code is executing in-place or taking any extra space.
Following is the easiest way of reversing a string in python:
string = 'SHWETA'
print(string[: : -1])
I just wanted to know if this code is executing in-place or taking any extra space.