25. Problem to remove element from the list using pop method.

In this program, we will take a user input as a list. Remove the from the list from a specific index using pop method. Print the final output with the help of the below-given steps.

Remove element from the list using pop method:

Steps to solve the program
  1. Take a list as input.
  2. Remove an element whose index is 2 using pop method.
  3. Print the output.
				
					#Input list
list1 = [33,56,89,12,45]

#Removing elements which is at
#2nd index and printing output
list1.pop(2)
				
			

Output :

				
					[33, 56, 12, 45]
				
			

Related Articles

Sort a list using the sort and sorted method

Find the max, min, and sum of the list

Leave a Comment