I have a nested list mixed with list and numbers.
nested = [[1, 2, 3], [4, 5, 6], [7, 8], [9], 10, 11]
The nested lists only contain numbers, they'll never contain more lists.
Is it possible to write a list comprehension to make new list from the 'nested' list, producing the following output?
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
This was my attempt( code is not working)
[num if isinstance(item, list) for num in item else item for item in nested]