Reverse a string
- string
- reverse
Using extended slice syntax:
s = "some string"
s[::-1]
Or using the reversed
method
s = "some string"
''.join(reversed(s))
Reverse a string
Using extended slice syntax:
s = "some string"
s[::-1]
Or using the reversed
method
s = "some string"
''.join(reversed(s))