Sometimes, we want to concatenate two lists in Python.
In this article, we’ll look at how to concatenate two lists in Python.
How to concatenate two lists in Python?
To concatenate two lists in Python, we can use the +
operator.
For instance, we write:
listone = [1, 2, 3]
listtwo = [4, 5, 6]
joinedlist = listone + listtwo
print(joinedlist)
Then joinedlist
is [1, 2, 3, 4, 5, 6]
.
Conclusion
To concatenate two lists in Python, we can use the +
operator.