How do I concatenate two lists in Python?
Example:
listone = [1, 2, 3]
listtwo = [4, 5, 6]
Expected outcome:
>&g
You could also use the list.extend() method in order to add a list
to the end of another one:
listone = [1,2,3]
listtwo = [4,5,6]
listone.extend(listtwo)
If you want to keep the original list intact, you can create a new list
object, and extend
both lists to it:
mergedlist = []
mergedlist.extend(listone)
mergedlist.extend(listtwo)