y2k y2k - 3 years ago 174
Python Question

How to concatenate two lists in Python?

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 Source

Python makes this ridiculously easy.

mergedlist = listone + listtwo
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download