I have a list, a:
a
a = [\'a\',\'b\',\'c\']
and need to duplicate some values with the suffix _ind added this way (
_ind
It can be shortened a little bit by moving the options to the inner for loop in the list comprehension:
a = ['a','b','c'] [item for x in a for item in (x, x + '_ind')] # ['a', 'a_ind', 'b', 'b_ind', 'c', 'c_ind']