Skip to content
Snippets Groups Projects
Question 1.py 194 B
def rev(val):
    if len(val) == 0:
        return val

    first = val[0]
    rest = val[1:]

    try:
        return rev(rest) + [first]
    except TypeError:
        return rev(rest) + first