"""author: @pythonpips"""

s = "PythonPips"

# using reversed() and .join 
>>> ''.join(reversed(s))
spiPnohtyP

# using slicing
>>> s[::-1]
spiPnohtyP
How to Reverse a String in Python

Subscribe to our newsletter