I've figured out how to create a reverse function when the parameter exists. However, I cannot seem to get it to work when the parameter takes the value of a raw_input.
Everything appears as expected on the console, but I keep receiving the error message:
Your function fails on reverse("Python!"). It returns "" when it should return "!nohtyP".
Please advise! Your help is greatly appreciated.
def reverse(x): x = raw_input("Give me a word to reverse: ") reverse =  word = len(x)-1 for letter in range(-1,word): reverse.append(x[word]) word -= 1 return "".join(reverse) print reverse("x")