7. reverse - it's working but giving an error 'message'



Error message I got was: Your function fails on reverse("Python!"). It returns "None" when it should return "!nohtyP".

My code actually gave me the expected answer... with the error...??!!
I don't understand why I got error message.

def reverse(text):
    result = {}
    x = len(text)-1
    for i in range(len(text)):
        result[i] = text[(i-x)*(-1)]
    final = "".join(result.values())
    print final,


hi , do not use "print",use "return".hope it can do some help for you.


Thanks for your comment.
It's working now! :slight_smile:


you are welcome!:slight_smile:


This is the first exercise where I didn't even know how to start lol


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.