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
Just another option:
from collections import deque def reverse(iterable): d = deque() d.extendleft(iterable) return ''.join(d)