7.reverse method error occurs


#1



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

!nohtyP
None

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!')


#2

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.


#3

this function is called reverse2? not reverse?


#5

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


#6

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


#7

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.


#8

ok
i understand the why we use here


#9