Categories
Python Answers

How to concatenate two lists in Python?

Spread the love

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

to combine listone and listtwo into one list and assign the joined list to joinedlist.

listtwo‘s entries will come after listone in joinedlist.

Conclusion

To concatenate two lists in Python, we can use the + operator.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *