I'm trying to reverse a string and it is working but is only returning reversed indexes (6543210) instead of the reversed string (which should be "!nohtyP") I don't know how to convert the numbers back into the letters to which they are assigned. Help is appreciated!
I get the error message: Oops, try again. Your function fails on reverse("Python!"). It returns "6543210" when it should return "!nohtyP".
Replace this line with your code. def reverse(text): reverse = "" for text in range(len(text)-1, -1, -1): reverse = reverse + str(text) return reverse