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
print(joinedlist)

Then joinedlist is [1, 2, 3, 4, 5, 6].

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 *