Languages
[Edit]
EN

Python - join two lists

0 points
Created by:
Mahir-Bright
1281

In this article, we would like to show you how to join two lists in Python.

1. Using + operator

Edit

In this example, we use + operator to join two lists.

Practical example:

Output:

2. Using extend() method

Edit

In this example, we use extend() method to add list2 at the end of list1.

Practical example:

Output:

3. Append items one by one

Edit

In this example, we use append() method to append items from list2 at the end of list1 one by one.

Practical example:

Output:

Alternative titles

  1. Python - concatenate lists
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Python - list (popular problems)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join