Incorrect error message in reverse?


#1



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


Hi, my code is returning the right answer but won't go through- am I missing something?
Error message: Your function fails on reverse("Python!"). It returns " !nohtyP" when it should return "!nohtyP".


Replace this line with your code. 
def reverse(text):
    texty = []
    for char in text:
        texty.append(char)
    p = len(text) - 1
    a = " "
    while p >= 0:
        a = a + texty[p]
        p -= 1
    return a


#2

here:

a = " "

the string is not empty, so the reversed string will have a leading space which shouldn't be there, make the string empty


#3

That's worked, thank you!!


#4