Practice makes Perfect - Reverse: HELP!


#1


This is my code, but for some reason it doesn't work. Can anybody help me, please!? Thanks!


def reverse(text):
    result = ""
    for c in range(len(text), 0, -1):
        result += text[c]
    return result


#2

You will want to be sure the loop reaches index [0] so set the stop value to -1.


#3

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