As usual, the itertools module contains a solution:
>>> l1=[1, 2, 3]
>>> l2=[4, 5, 6]
>>> l3=[7, 8, 9]
>>> import itertools
>>> list(itertools.chain(l1, l2, l3))
[1, 2, 3, 4, 5, 6, 7, 8, 9]
More Related Contents:
- How do I concatenate two lists in Python?
- How do I concatenate items in a list to a single string?
- In Python, what is the difference between “.append()” and “+= []”?
- How to concatenate (join) items in a list to a single string
- Ellipsis lists […] and concatenating a list to itself [duplicate]
- Concatenate elements of a tuple in a list in python [duplicate]
- Replace list object based on indexes of another list (Python)
- User input integer list [duplicate]
- Transpose list of lists
- Sorting list based on values from another list
- Circular list iterator in Python
- 2D list has weird behavor when trying to modify a single value [duplicate]
- python filter list of dictionaries based on key value
- How to iterate over a list in chunks
- How do I remove duplicates from a list, while preserving order?
- Merging dictionary value lists in python
- Check if an item is in a nested list
- Print list of lists in separate lines
- Find object in list that has attribute equal to some value (that meets any condition)
- Perform a string operation for every element in a Python list
- Setting a value in a nested Python dictionary given a list of indices and value
- Change a string of integers separated by spaces to a list of int
- Generate all possible lists of length N that sum to S in Python
- Why do two identical lists have a different memory footprint?
- How to sort a list of objects based on an attribute of the objects in descending order?
- Python – shuffle only some elements of a list
- Find starting and ending indices of sublist in list
- Converting List Comprehensions to For Loops in Python
- How do I send list of dictionary as Body parameter together with Files in FastAPI?
- In what case would I use a tuple as a dictionary key? [closed]