Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to concatenate two lists in python

list1 = ["Hello ", "take "]
list2 = ["Dear", "Sir"]

resList = [x+y for x in list1 for y in list2]
print(resList)

#['Hello Dear', 'Hello Sir', 'take Dear', 'take Sir']
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #concatenate #lists #python
ADD COMMENT
Topic
Name
7+1 =