Problem with Exercise: "reverse"


So, this code appears to work perfectly; when I execute it, it prints "!nohtyP" as it should. The website, however, tells me:

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

So what's wrong here? Is this my code or some flaw in how the website is reading it?

def reverse(text):
    s = ""
    for char in text:
        a.insert(0, char)
    print s.join(a)



Hello @cloudace95799,

while your function prints the result, it doesn't return it. Instead of using the print statement with your result, use the return statement instead...