Reverse, code is correct but it tells me that is is wron :(


#1



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


Oops, try again. Your function fails on reverse("Python!"). It returns "None" when it should return "!nohtyP".


when i run it in the complier it prints clearly the reversed, but i get error message from page


def reverse(text):
    a=[]
    for n in range(len(text)-1,-1,-1):
        a.append(text[n])
    print "".join(a)
    
reverse("Python!")


#2

your function should return the reversed string, you print the reversed string


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.