23. Problem to add two lists using extend method.

In this program, we will take two lists as inputs and combine them to make a single list using extend method with the help of the below-given steps.

Add lists using extend method:

Steps to solve the program
  1. Take two lists as input.
  2. Add them using extend().
  3. Print the output.
				
					#Input lists
list1 = [2,4,6,8,1]
list2 = [23,56,11,89]

#Combining lists
list1.extend(list2)

#Printing output
print(list1)
				
			

Output :

				
					[2, 4, 6, 8, 1, 23, 56, 11, 89]
				
			

Related Articles

List of words which has vowels in string

Sort a list using the sort and sorted method

Leave a Comment