How to concatenate two lists in python?
![](https://pythonpoint.net/wp-content/uploads/2020/12/Yellow-and-Pink-Beauty-and-Fashion-Blog-Banner-7-1024x576.jpg)
A list is a data-structure, or it can be considered a container that can be used to store multiple data at once. The list will be ordered and there will be a definite count of it.
Here we’ll see some examples to concatenate lists in python.
e.g., using ‘+’ sign
l1=[1, 2, 3, 4, 5] l2=[6, 7, 8, 9, 10] l3=l1+l2 print(l3)
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1134-1024x256.png)
e.g., using extend function.
l1=[1, 2, 3, 4, 5] l2=[6, 7, 8, 9] l1.extend(l2) print(l1)
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1136-1024x244.png)
e.g., using ‘*’ operator
t1 = [1, 4, 5, 6, 5] t2 = [3, 5, 7, 2, 5] t = [*t1, *t2] print (t)
![](https://pythonpoint.net/wp-content/uploads/2020/12/Screenshot-1138-1024x276.png)
This is all about list concatenation in python.
Subscribe
Login
Please login to comment
0 Discussion