How to concatenate element-wise two lists in Python?

后端 未结 8 2498
春和景丽
春和景丽 2020-11-29 02:24

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 :

         


        
8条回答
  •  清酒与你
    2020-11-29 02:57

    Using zip

    [m+str(n) for m,n in zip(b,a)]
    

    output

    ['asp10', 'asp11', 'asp15', 'asp16', 'asp210', 'asp211']
    

提交回复
热议问题