1 of 5
Exercise #1beginner

Reverse a String

Given a string text = "Gradient School", write Python code to reverse the string using Python slice syntax with a negative step. Print the reversed string.

Instructions

  • Use extended slicing syntax `[start:stop:step]`.
  • A step of `-1` reverses any sequence.
  • Print the reversed result.
Progressive Hints (1 / 2)

String slicing in Python has three parameters: `[start:stop:step]`.

solution.py
Loading Monaco Editor...

Press Ctrl+Enter or click "Run Code" to execute your solution in the browser.