Help me on the codes for Reverse exercise



I have been struggling with my code for Reverse exercise. Can anyone help me please?

Link to the exercise:

Here is my code:

def reverse(x):
    revd = []
    x = str(x)
    for n in x:
    print "".join(revd)


When I hit the "Save & Submit Code" button, the terminal returns "!nohtyP", which looks perfect.

However, it keeps showing this error message:
"Oops, try again. Your function fails on reverse("Python!"). It returns "None" when it should return "!nohtyP"."

Can anyone please help me figure out what went wrong with my code?



from the instructions:

Define a function called reverse that takes a string text and returns that string in reverse

there is a important word in this sentence: returns, this should ring a bell, that you might need to use a return keyword


Hello stetim94

Thanks a lot! The error is solved when I replace print with return.