def nested_list(n):
    """Generate a nested list where the i'th item is at depth i."""
    lis = []
    for i in range(n):
        if i == 0:
            lis.append(i)
        else:
            lis.append(nested_item(i, i))
    return lis
Generate a nested list where the i'th item is at depth i.
recipes/Python/578948_Flattening_arbitrarily_nested_list/recipe-578948.py