It takes only three lines

s = 'arsemhMCsy ritr' l = [6,3,1,11,9,10,7,5,14,12,8,13,4,0,2] print((lambda s, l: ''.join([s[i] for i in l]))(s,l)+'!') Merry Christmas candle Merry Christmas!