I have a list, a:
a
a = [\'a\',\'b\',\'c\']
and need to duplicate some values with the suffix _ind added this way (
_ind
Another alternative with splicing (Python2.x, 3.x):
result = [None] * len(a) * 2 result[::2], result[1::2] = a, map(lambda x: x + '_ind', a) result # ['a', 'a_ind', 'b', 'b_ind', 'c', 'c_ind']