7. reverse - Weird error?


#1

Not sure what's happening, but this is my code:

word = ["krankenleutenhausauto"]

def reverse(text):
    finalstring = []
    test = str(text)
    letters = str.split(test, len(test))
    for letter in letters:
        finalstring.append(letters.index(len(letters)))
    return finalstring

print reverse(word)

and this is the weird error I get:

Oops, try again. Does your reverse function take exactly one argument (a string)? Your code threw a "expected a character buffer object" error.


#2

If word is meant to be a string, then why dress it as a list? I fail to see how you do not see the error message for what it is. It asks the same question.


#3

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