M
mooremathewl
What's the best way to accomplish this? Am I over-complicating it? My gut feeling is there is a better way than the following:
['insertme', 1, 'insertme', 2, 'insertme', 3]
I appreciate any and all feedback.
--Matt
import itertools
x = [1, 2, 3]
y = list(itertools.chain.from_iterable(('insertme', x) for i in range(len(x))))
y
['insertme', 1, 'insertme', 2, 'insertme', 3]
I appreciate any and all feedback.
--Matt