I have this list:
l=['abcdef', 'abcdt', 'neft', 'ryr', 'yyyyy', 'u', 'aaaaaaaaaa']
and, the length of each elements in the above list is 6,5,4,3,5,1,10
respectively.
I wish to combine it in a way such that it satisfies a condition: Each element in the newly created list should be at least of length 10, that means, consider the next elements for combining until the desire length is reached. Spaces will be added at every joining point.
Thus, the list now becomes:
l=['abcdef abcdt', 'neft ryr yyyyy', 'u aaaaaaaaaa']
I tried combining it up based on iterations and other ways but nothing seems to work. Any suggestions?