Reverse - Code apparently works, but Codecademy doesn't approve it


Hello everyone!

I'm in lesson 'reverse' (link below) and my code apparently is working, as I tested it and got the correct results on the console, but Codecademy doesn't approve it.

This is my code:

def reverse(text):
    result = ""
    n = len(text) - 1
    for char in text:
        result += text[n]
        n -= 1
    print result

and this is the error message I get:

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

Is this a bug? Or my code is indeed incorrect in someway?

Thanks in advance!


you print the reversed string, you should return it


Thanks for the prompt help, stetim!