Incorrect error message in reverse?


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:
    p = len(text) - 1
    a = " "
    while p >= 0:
        a = a + texty[p]
        p -= 1
    return a



a = " "

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


That's worked, thank you!!