It's obvious i'm doing something wrong. Can someone assist me with this problem. Thanks in advance guys.

Replace this line with your code. 
def reverse(text):
    t = []
    for i in range(len(text)):
        return t


a function ends the moment a return keyword is reached, you might want to change the indention of the return so the whole for loop can run


Thanks, is that all I have to do or I still need to modify it a bit ?


there is more to be done. Currently you are appending t to text, not sure that is right, and you are not reversing anything


Oopsie yeah you're right. Thanks for the call out, I will fix it :sweat:


First, try unindenting

return t

so it's on the same indent as your for loop statement.
Now, the append() 's syntax is \

Targetlist.append(item[index])  #where index is optional

I'm assuming you want to put the reversed phrases in your new list, t. So, your Targetlist should be t. As for item, since it's in the loop, you are iterating all the letters in it. I suggest you append the text backwards to your new list t. You can do that like this:

1.Set your index variable equal to the index at the end of the list:

 index = len(text)-1

2.In append function, set the [index] with your index variable
3.Subtract index variable by 1
4.Lastly, in your return, join the list of strings into one string like so:

"".join(t) #If you don't do this, you'll get a list of stings eg. ["!","y", "e", "H"]


def reverse(text):
t = []
chop = len(text)- 1
for i in range(len(text)):
chop -= 1
return "".join(t)

Still not working. You meant subtract by 1 after the .append right ?


 t.append(text[chop]) #You did it the other way

The rest is good :slight_smile:


Wait we haven't won the battle just yet. :weary: Now it's saying "Oops, try again. Does your reverse function take exactly one argument (a string)? Your code threw a "'str' object is not callable" error."


Can you show me what you have now with proper indents?



def reverse(text):
t = []
chop = len(text) - 1
for char in range(len(text)):
chop -= 1
return "".join(t)


Sorry I don't know how to take a screenshot but yupp except the return line is right underneath "chop -= 1" and align with "for"


Lmaooooo wow All I had to do was change the parentheses on "t.append(text[chop])"


Thanks for the help, I appreciate it. I really do :slight_smile:


Haha, stuff like that happend xD I'm glad you solved it.