← Back to challenges

Reverse the Order of a String

PythonHardstringsformattingsorting

Instructions

Create a function that takes a string as its argument and returns the string in reversed order.

Examples

reverse("Hello World") ➞ "dlroW olleH"

reverse("The quick brown fox.") ➞ ".xof nworb kciuq ehT"

reverse("Sample is really helpful!") ➞ "!lufpleh yllaer si elpmaS"

Notes

You can expect a valid string for all test cases.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Semantic Versioning