Flattens a list.

    Example:

    >>> flatten([a,b,[c,d,[e,f]]])
    [a,b,c,d,e,f]

def flatten(L):
    """
    Flattens a list.

    Example:

    >>> flatten([a,b,[c,d,[e,f]]])
    [a,b,c,d,e,f]
    """
    if not isinstance(L, list):
        return [L]

    if L == []:
        return L

    return flatten(L[0]) + flatten(L[1:])