Merge some list items in a Python List
On what basis should the merging take place? Your question is rather vague. Also, I assume a, b, …, f are supposed to be strings, that is, ‘a’, ‘b’, …, ‘f’. >>> x = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’] >>> x[3:6] = [”.join(x[3:6])] >>> x [‘a’, ‘b’, ‘c’, ‘def’, ‘g’] Check out the … Read more