I have one list like this:
a = [3, 4, [1], 8, 9, [3, 4, 5]]
i would like to identify when that list with those characteristics has only one value, and then extract it to the main list:
Expected output
a = [3, 4, 1, 8, 9, [3, 4, 5]]
I know how extract values in a list composed of lists, but in this case i don’t know how
My solution is simple and straightforward:
Or the same but one line