I have a huge nested list which its elements are word strings with the following form:
[[0,'+','the','+','quick','+','brown','+','fox','+','jumps','over','+','the','+','lazy','+','dog','+',908]
...,
['Now','+','is','+', 'the','+', 'time','+', 'for','+', 'all','+', 67,'+', 'men']]
However, I identified that there are some elements with no +
separator. For example, in sublist one:
[0,'+','the','+','quick','+','brown','+','fox','+','jumps','over','+','the','+','lazy','+','dog','+',908]
Between 'jumps','over'
is missing +
. For large nested lists with long sublists, which would the most efficient way of adding the +
separator between elements with no separator?
The expected output should look like this:
[[0,'+','the','+','quick','+','brown','+','fox','+','jumps','+','over','+','the','+','lazy','+','dog','+',908]
...,
['Now','+','is','+', 'the','+', 'time','+', 'for','+', 'all','+', 67,'+', 'men']]
'+'
s and process the list accordingly instead? – Selcuk Sep 5 '19 at 0:41+,+,+
in the original list. – ComplicatedPhenomenon Sep 5 '19 at 0:45+
@ComplicatedPhenomenon – anon Sep 5 '19 at 0:48