7. Reverse


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/1?curriculum_id=4f89dab3d788890003000096

<In what way does your code behave incorrectly? Include ALL error messages.>
Error: Your function fails on reverse(“Python!”). It returns “!” when it should return “!nohtyP”.

<What do you expect to happen instead?>
Apparently, I can get the last of the string printed, but for some reason I cannot get it to loop.

```python

def reverse(text):
rev = ‘’
length = len(text)
for i in range(length):
rev += text[length-1]
return rev
length -= 1
print rev

<do not remove the three backticks above>

Any ideas?

#2

replace print by return , and remove return rev