I came across a strange Codecademy exercise that required a function that would take a string as input and return it in reverse order. The only problem was you could not use
You can do simply like this
def rev(str): rev = "" for i in range(0,len(str)): rev = rev + str[(len(str)-1)-i] return rev