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
Here is one using a list as a stack:
def reverse(s): rev = [_t for _t in s] t = '' while len(rev) != 0: t+=rev.pop() return t