Ajax-loader-large-white
Practice Makes Perfect
reverse

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

Instructions

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.

script.py