HI Everyone,

I am stuck at this exercise and not sure what I am doing wrong. Any help?


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

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


Indentation need to be fixed here.
as at first iteration it appends the first letter in reverse and it sees return statement and when function sees return statement it executes it and halts the process.


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