When length = 0, I get this error: Oops, try again. Your code looks a bit off–it threw a “string index out of range” error. Check the Hint if you need help!
When I changed length to 1, I got this: Oops, try again. Your function fails on reverse(“Python!”). It returns “!nohty” when it should return “!nohtyP”.
Now if the “P” is cut off when I use 1, but 0 is out of range… these messages seem to contradict.
def reverse(text): final = "" length = 1 while length < len(str(text)): final += text[len(str(text)) - length] length += 1 return final