Your question is String Reverse Explanation. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
X Development processes user-entered labels that sometimes need to be displayed in reverse order. Given a string, return a new string containing the same characters in reverse order.
Implement reverse_string(s), where s is a Python string. Return a string whose characters appear in the opposite order. The input may contain letters, digits, spaces, punctuation, and Unicode characters. Do not modify the original string, since Python strings are immutable.
You may use standard Python string or sequence operations. The result must contain every input character exactly once, in reverse positional order.
def reverse_string(s):