← How-To Guides How-To How to reverse a string Use slicing s[::-1] or reversed() with ''.join(). Slicing s[::-1] creates a reversed copy. s = 'hello' rev = s[::-1] # 'olleh'