I have two lists and I want to concatenate them element-wise. One of the list is subjected to string-formatting before concatenation.
For example :
inputs:
a = [0, 1, 5, 6, 10, 11] b = ['asp1', 'asp1', 'asp1', 'asp1', 'asp2', 'asp2'] concat_func = lambda x,y: x + "" + str(y) list(map(concat_func,b,a)) # list the map function
output:
['asp10', 'asp11', 'asp15', 'asp16', 'asp210', 'asp211']