On 23 November 2016 at 19:40, Daiyue Weng <daiyuew...@gmail.com> wrote: > Hi, I am wondering how to concatenate corresponding strings in two lists, > assuming that the lists are of same length, e.g. > > val_1 = ['a', 'b', 'c'] > val_2 = ['A', 'B', 'C'] > > # concatenate corresponding strings in 'val_1' and 'val_2' > # and put results in another list 'val' so that > # val = ['aA', 'bB', 'cC'] > > cheers > -- > https://mail.python.org/mailman/listinfo/python-list
one way to do it: val = [''.join(pair) for pair in zip(val_1, val2)] -- https://mail.python.org/mailman/listinfo/python-list