Practice Makes Perfect

Great work so far! Let's practice writing some functions that work with strings.


Define a function called reverse that takes a string textand returns that string in reverse.

For example: reverse("abcd") should return "dcba".

  1. You may not use reversed or [::-1] to help you with this.
  2. You may get a string containing special characters (for example, !, @, or #).
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Consider how you would loop through text starting from the last character through the first character.