Reverse


#1

https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/1?curriculum_id=4f89dab3d788890003000096

Oops, try again. Your function fails on reverse("Python!"). It returns " !nohtyP" when it should return "!nohtyP". My output says exactly that...would this be a bug in the system?

This is my output: What's your favorite word? Python!
!nohtyP
None

def reverse(text):
    backwards = ' '
    for i in range(len(text),0,-1):
        backwards = backwards + text[i-1]
    return backwards

text = raw_input("What's your favorite word? ")
print reverse(text)

#2

Start backwards as an empty string, '' or "".