Hello! This is my first time posting to the Q&A forum so please let me know I'm breaking any etiquette -- I did my best to ask my question clearly.
I'm working on the exercise "Reverse" (Python --> Practice Makes Perfect --> Reverse)
My question is : Why my code producing the following error message? When I call the function on a string, it correctly produces the string in reverse (e.g. "rhino" becomes "onihr") but I'm still getting the error message below:
Oops, try again. Your function fails on reverse("Python!"). It returns "None" when it should return "!nohtyP".
def reverse(text): x = len(text) - 1 for char in text: print text[x], x -= 1
Thank you for any help!