Instagram
youtube
Facebook
Twitter

Python Program to Merge Two Lists

    Python Program to Merge Two Lists
     Code Description:    
     This program merges two lists (list1 and list2) using the + operator, which combines their       elements into a single new list (merged_list).


     Explanation (Dot Points):
     • Two separate lists are created:
      list1 = [1, 2, 3, 4]
      list2 = [5, 6, 7, 8]

• The + operator is used to join both lists:
merged_list = list1 + list2

• This operation creates a new list that contains all elements from list1 followed by all elements from list2.

• The result is printed using print("Merged List:", merged_list)

Program:

list1 = [1, 2, 3, 4]

list2 = [5, 6, 7, 8]

merged_list = list1 + list2

print("Merged List:", merged_list)