Reverse 7/15 HELP!


Im confused. I have rewritten this code in many different ways and this is the simplest way i could write it and it gives me an error but the error makes no sense.
Here is my code:
def reverse(text):
x = " "
count = 0
for i in text:
x = x + text[len(text) - count - 1]
count = count + 1
return x

and here is the error message i got.
Oops, try again. Your function fails on reverse("Python!"). It returns " !nohtyP" when it should return "!nohtyP".

it returns !nohtyP instead of !nohtyP. My brain is tweeking out.


Take a very close look at these two strings

Yours : " !nohtyP"

Remember a space will make a difference in the the strigs


You were right.

x = ""

there shouldn't have been a space between the quotation marks. Thank you @rydan