y2k y2k - 7 months ago 6
Python Question

How to append list to second list (concatenate lists)

How do I concatenate two lists in Python?

Example:

listone = [1, 2, 3]
listtwo = [4, 5, 6]


Expected outcome:

joinedlist == [1, 2, 3, 4, 5, 6]

Answer

Python makes this ridiculously easy.

mergedlist = listone + listtwo
Comments