Reverse error


#1


When I run my code for this section, I am finally able to get the word to print in reverse on the screen, however, I keep getting an error message that says my code fails when the word is "Python!" it returns none when it should return "!nothyP" I tested the code with "Python!" and it printed the correct string on the console. Not sure what I need to do to progress.


def reverse(text):
    x = len(text)-1
    word = ""
    while x >= 0:
        letter = text[x]
        x -= 1
        word = word + letter
    print word
 
       

reverse("Python!")


#2

on the last line of your function:

print word

you print word, but the exercise asks you to return the result (word), not print it.

In case the hint wasn't obvious, use return instead on print on the line in question