Python Program to remove an element from a list (pop() Method)

bookmark

# Python program to show how to use the pop() function    
      
lst = ["Python", "Remove", "Elements", "List", "Tutorial"]    
print("Initial List is :", lst)    
      
# using pop() function to remove element at index 2 of the list    
element = lst.pop(2)    
print("Element that is popped :", element)    
print("List after deleting the element", lst)    


Output:

Initial List is : ['Python', 'Remove', 'Elements', 'List', 'Tutorial']
Element that is popped : Elements
List after deleting the element ['Python', 'Remove', 'List', 'Tutorrial']