Reverse


#1

def reverse(text):
    word = str(text)
    length = len(word)
    hold = []
    while length > 0:
        hold.append(word[length-1])
        length -= 1
    null = ''
    reversed = null.join(hold)
    print reversed
print reverse("Python!")

whats wrong with my code??


Reverse - practice make perfect
#2

your function prints the reversed string, it doesn't return the reversed string


#3

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