What does this expression mean: string[::-1]
in python.
Here is the sample code:
def reverse_string(string): return string[::-1]
I know this is used for reversing a string, but how does this expression work?
What does this expression mean: string[::-1]
in python.
Here is the sample code:
def reverse_string(string): return string[::-1]
I know this is used for reversing a string, but how does this expression work?