← Programming questions
Easy / PYTHON

String Reversal

strings · python_basics 7 minute study target

Not completed

Challenge

Implement string_reversal(word), returning the characters of the Python string in reverse order. Preserve spaces, case, punctuation, and Unicode code points. The empty string returns the empty string. Reverse code points, not grapheme clusters. Do not print the answer.

Target complexity: O(n)

Return values are checked by type. Use the exact function name. Print output is not your answer. Tests have time and memory limits.

Public examples

Example 1

Arguments

['EverythingQuant']

Expected return

tnauQgnihtyrevE
Example 2

Arguments

['ab']

Expected return

ba
Hint

Match the return value and type to the contract.

The worked solution unlocks after completion, or with Premium access.

string_reversal.pyPython 3.12

Drafts are saved to your account, not to shared browser storage.

Sign in to submit code and save progress.

Results

Your results will appear here.

Hidden tests reveal only their pass/fail status, never their inputs or expected outputs. Runtime is observed wall time—not an inferred complexity class.

© 2026 EverythingQuant. All Rights Reserved.