Python Merge List Program

Here is the easy way to merge 2 or more lists in Python Programming.

Step to Merge list :

In this program we are going to merge 2 lists.

  1. Create the FIRST list

li=[10,20,30]

2. Create the SECOND list

li2=[40,50,60]

3. Now create another list and add both the list in the THIRD list using the addition operation

li3=li+li2

4. In the final step you simply have to print the print the THIRD list in which you store the addition of both the list.

print(li3)

Program to Merge List in python

# python merge list

# creating list 1
li=[10,20,30]

# creating list 2
li2 = [40,50,60]

# python merge list 1 and list 2
li3=li + li2
print(“Python Merge List”)

# print merged list
print(li3)

This program will give the following output

Python Merge List

[10,20,30,40,50,60]

So there was the simple python merge list program I hope you found it helpful. If you found this helpful or have any suggestions fill free to tell me.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store