7 python! is giving me troubles


So I somehow made it to a working code, probably the hardest way to make it lol, but it works, trouble is that when its tested with "Python!", the "!" messes the whole thing up
my code is:

def reverse(texto):
    palabra = str(texto)
    valor_letra = len(palabra)
    letras = {}
    reversa = ""
    for key in (palabra):
        valor_letra -= 1
        letras[valor_letra] = "%s" %key

    for key in letras:   
        reversa += "%s" %letras[key]

    print reversa
    return reverse


Its spanish, but you shouldnt have troubles with it

The error message says the code returns "function reverse at 0x7eff38674938" instead of "!nohtyP"



In your reverse() Method
instead of return reverse

return reversa

As the call of your reverse() Method return's a Value
change the call into

print reverse("Hola")


Thank you very much n.n


A post was split to a new topic: How can I reset the lesson to start from lesson 1