Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
No results
  • About AskPython
  • Blog
  • Contact Me
  • Free Online Developer Tools Hub
  • Home
  • Meet the Team
  • Privacy Policy
  • Python
  • Python Course for Beginners Online FREE
  • Python Tutorial – Mega Index
  • Terms and Conditions

🚀 Supercharge your YouTube channel's growth with AI.

Try YTGrowAI Free
  • Home
  • Blog
  • About AskPython
  • Python Course
  • Start Here

Ways to concatenate multiple lists in Python

  • Safa MulaniSafa Mulani
  • February 28, 2020
  • Python List
Ways to concatenate multiple lists in Python

In this article, we will understand various techniques to concatenate multiple lists in Python. Python lists provide us a way to store data and perform manipulations on it.

Techniques to concatenate multiple lists in Python

Either of the following techniques can be used to concatenate two or more lists altogether:

  • By using itertools module
  • By using Python ‘+’ operator
  • By using Python ‘*’ operator

1. Using Python itertools.chain() method

Python itertools module provides us with itertools.chain() method to concatenate multiple lists together.

The itertools.chain() method accepts data of different iterables such as lists, string, tuples, etc and provides a linear sequence of elements out of them.

This function works irrespective of the data type of the input data.

Syntax:

itertools.chain(list1, list2, ...., listN)

Example:

import itertools 


x = [10, 30, 50, 70] 
y = [12, 16, 17, 18] 
z = [52, 43, 65, 98] 


opt = list(itertools.chain(x,y,z)) 


print ("Concatenated list:\n",str(opt)) 

Output:

Concatenated list:
 [10, 30, 50, 70, 12, 16, 17, 18, 52, 43, 65, 98]

2. Using Python ‘*’ operator

Python '*' operator provides a much efficient way to perform manipulation on the input lists and concatenate them together.

It represents and unwraps the data elements at their provided index position.

Syntax:

[*input_list1, *input_list2, ...., *inout_listN]

As mentioned, the *input_list1, *input_list2, etc would contain elements within that list at the given index in the mentioned order.

Example:


x = [10, 30, 50, 70] 
y = [12, 16, 17, 18] 
z = [52, 43, 65, 98] 

opt = [*x, *y, *z] 


print ("Concatenated list:\n",str(opt)) 

Output:

Concatenated list:
 [10, 30, 50, 70, 12, 16, 17, 18, 52, 43, 65, 98]

3. Using Python “+” operator

Python '+' operator can be used to concatenate the lists together.

Syntax:

list1 + list2 + .... + listN

Example:


x = [10, 30, 50, 70] 
y = [12, 16, 17, 18] 
z = [52, 43, 65, 98] 


opt = x+y+z

print ("Concatenated list:\n",str(opt)) 

Output:

Concatenated list:
 [10, 30, 50, 70, 12, 16, 17, 18, 52, 43, 65, 98]

Conclusion

Thus, in this article, we have unveiled different ways to concatenate multiple lists in Python.


References

Ways to concatenate list in Python

Safa Mulani
Safa Mulani

An enthusiast in every forthcoming wonders!

Articles: 189
Python String to float, float to String
Previous Post Python String to float, float to String
Next Post The Python float() Method
The Python float() Method

Related Posts

Python Reverse List: Methods and Examples

Python Reverse List: Methods and Examples

  • November 28, 2026
Python Empty List: How to Check It

Python Empty List: How to Check It

  • November 24, 2026
How to Square in Python: List Values

How to Square in Python: List Values

  • November 24, 2026

Partner Websites

  • GoLangDocs
  • LinuxForDevices
  • CodeForGeek

Popular Categories

  • Python Programming
  • Python Modules
  • OOPS in Python
  • Python Programming Examples
  • Strings in Python

Hall of Fame

  • Python Programming
  • OOPS in Python
  • Creating Python Modules
  • Args and Kwargs in Python
  • Python Dictionary (Dict) Tutorial
  • Python List – 15 Things You MUST Know
  • Python Set – Things You MUST Know
  • Python String Functions: Methods by Task

Important Links

  • Home
  • Python Course
  • Start Here
  • Blog
  • About AskPython
Latest posts
  • np.linalg.eig: Eigenvalues and Eigenvectors
  • What Does %s Mean in a Python Format String?
  • How to Use np.sin() in NumPy
  • cv2.imread: Load Images with OpenCV
  • pd.read_json: Read JSON Into a DataFrame

Copyright © 2026 - AskPython. All rights reserved.