For example, I have following two lists
listA=[\'one\', \'two\' , \'three\'] listB=[\'apple\',\'cherry\',\'watermelon\']
How can I pair those two lists to
Using list comprehension and zip:
listA=['one', 'two' , 'three'] listB=['apple','cherry','watermelon'] new_list = [a+" "+b for a, b in zip(listA, listB)]
Output:
['one apple', 'two cherry', 'three watermelon']