What's worng in my code?


#1



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

I think my code works fine, I printed out it with examples:
dcba
!nohtyP

doesn't that mean the result is correct?


def reverse(text):
    reverse_text = ''
    for char in text:
        reverse_text = char + reverse_text
    print reverse_text
    
print reverse('abcd')
print reverse('Python!')


#2

you need to return reverse_text


#3

ah, that's why..
I got it. thanks.