7.reverse method error occurs


i tried to return .join method ,but it does returns the method

Oops, try again. Your function fails on reverse("Python!"). It returns "!" when it should return "!nohtyP".

output is


somebody explain where i made mistake and want i am missing

def reverse2(text):
    word = []
    for i in range(len(text)):
        word.append(text[len(text)-i - 1])
    return ''.join(word)
print reverse2('Python!')


Rename reverse2 to reverse in all instances and remove any previous reverse function.

Codecademy is running a different function than you think it is. Be careful with names.


this function is called reverse2? not reverse?


thanks for the help
I thought we can def our own name in def function


can I define a function name in reverse 2?
why I can't use this name pls explain me


the exercise needs to validate your function successfully reverse strings, this is done by calling the function with different strings.

the exercise expects the function to be named reversed, that is what the exercise calls.


i understand the why we use here