def deepList(LString):
    '''
    Given string representation of a nested list tree,
    return a list containing all the deepest list contents.

    For example:

    '[[1,[2, 2a]],[[3,3b],4]]'
    ==> ['2, 2a', '3,3b']

    '[[[1,[2, 2a]],[[3,3b],4]],6]'
    ==> ['2, 2a', '3,3b']

    '[[[[a1,a2],out],o1],[o2,o3]]'
    ==> ['a1,a2', 'o2,o3']

    '[[[[[a1,a2], out], [o1,o2]],[o3,o4]],[o5,o6]]'
    ==> ['a1,a2', 'o1,o2', 'o3,o4', 'o5,o6']

    The code: [x.split(']') for x in code.split('[')]
    returns something like:
    [[''], [''], [''], [''], [''], ['a1,a2', ', out', ', '],
    ['o1,o2', '', ','], ['o3,o4', '', ','], ['o5,o6', '', '']]

    '''
    result= [x[0] for x in \
            [x.split(']') for x in LString.split('[')] \
            if len(x)>1]
    if result==['']: result =[]
    return result

    Given string representation of a nested list tree,
    return a list containing all the deepest list contents.

    For example:

    '[[1,[2, 2a]],[[3,3b],4]]'
    ==> ['2, 2a', '3,3b']

    '[[[1,[2, 2a]],[[3,3b],4]],6]'
    ==> ['2, 2a', '3,3b']

    '[[[[a1,a2],out],o1],[o2,o3]]'
    ==> ['a1,a2', 'o2,o3']

    '[[[[[a1,a2], out], [o1,o2]],[o3,o4]],[o5,o6]]'
    ==> ['a1,a2', 'o1,o2', 'o3,o4', 'o5,o6']

    The code: [x.split(']') for x in code.split('[')]
    returns something like:
    [[''], [''], [''], [''], [''], ['a1,a2', ', out', ', '],
    ['o1,o2', '', ','], ['o3,o4', '', ','], ['o5,o6', '', '']]

    
recipes/Python/278258_List_Tools/recipe-278258.py