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

Replace this line with your code. 
def reverse(text):
    for char in text:
    while a>0: 
    for i in y :
        return i
what's wrong with my code?


for i in y :
        return i

Your function returns first letter, and then stops. You shouldn't return every i, but store it in a variable.


@dalachowsky is right, you will need to create a string so you can loop over the list and concatenate to string, or use build in function like .join()


how do i use the built in function .join??


also consider to simply use a loop to concatenate to an empty string


I solved that, by just changing the loop like that, and returning the result

for i in y :
        result += i


thank you very much dalachowsky!!


thank you very much stetim94!!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.