Deviopath › Python

Reverse a String

Easy · Strings

Slicing takes part of a string with text[start:stop:step]. Leaving out start and stop and using a step of -1 walks the string backwards: text[::-1].

Write a function reverse(text) that returns the string reversed.

Next: Format a Price