VOOZH about

URL: https://www.geeksforgeeks.org/python/how-to-join-a-list-of-tuples-into-one-list/

⇱ How to Join a list of tuples into one list? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Join a list of tuples into one list?

Last Updated : 11 Jul, 2025

In Python, we may sometime need to convert a list of tuples into a single list containing all elements. Which can be done by several methods.

The simplest way to join a list of tuples into one list is by using nested for loop to iterate over each tuple and then each element within that tuple. Let's see with the help of an example:


Output
[1, 3, 5, 4]

Let’s explore the different methods to join a list of tuples into one list.

Using List Comprehension

Python list comprehension provides a compact way to achieve the same result with a more concise syntax.


Output
[1, 3, 5, 4]

Explanation:

  • The outer loop (for t in a) iterates over each tuple in the list a.
  • The inner loop (for val in t) iterates over each element in the current tuple.
  • Each val is added to the new list b.

Using itertools.chain()

Python's itertools module provides a very efficient way to flatten a list of tuples using chain().


Output
[1, 3, 5, 4]

Explanation:

  • itertools.chain()is a function that can concatenate multiple iterables into one.
  • By using the *a syntax, we unpack all tuples in the list a as separate arguments to chain().
  • Finally, we convert the result to a list using list().

Note: Prefer the above method (i.e. itertools.chain() ) for large datasets due to better efficiency.

Which Method Should You Use?

  • For Loop: Use it if you're new to Python or if readability is your primary concern.
  • List Comprehension: Recommended for compact, readable code when performance isn't an issue.
  • itertools.chain(): Best for large datasets or when you want the most optimized solution.

Related Articles:

Comment