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 :
Using zip
[m+str(n) for m,n in zip(b,a)]
output
['asp10', 'asp11', 'asp15', 'asp16', 'asp210', 'asp211']
b = ['asp1', 'asp1', 'asp1', 'asp1', 'asp2', 'asp2']
aa = [0, 1, 5, 6, 10, 11]
new_list =[]
if len(aa) != len(b):
print 'list length mismatch'
else:
for each in range(0,len(aa)):
new_list.append(b[each] + str(aa[each]))
print new_list