Strings · Beginner · 40 XP · about 3 min
Write a function called reverse_string(s) that returns the reversed version of the input string.
reverse_string("hello") # Returns "olleh" reverse_string("Python") # Returns "nohtyP" reverse_string("a") # Returns "a" reverse_string("") # Returns ""
Ready?
Accept the challenge to start writing. A small timer counts the time this page is in view.
Output appears here.