7. Reverse


#1



https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/1?curriculum_id=4f89dab3d788890003000096


Error: Your function fails on reverse("Python!"). It returns "!" when it should return "!nohtyP".


Apparently, I can get the last of the string printed, but for some reason I cannot get it to loop.


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

Any ideas?


#2

replace print by return , and remove return rev