Skip to contentKEEP THE CRAFTTHE SANCTUARY

Reverse Text with Slicing

Reverse a string with one slice and learn why start and stop can be left out.

The problem

Implement reverse_text(value). Return a new string with the characters of value in reverse order. Use slice notation; do not call reversed(). value may be empty.

Starter code

def reverse_text(value: str) -> str:
    pass

Public examples

  1. value = "python"gives"nohtyp"

Solving it in the practice book needs an active paid plan.

Open it in the practice book
One thought at a time.