In Python Built-In List remove(obj) method is used to search for the given element in the list and removes the first matching element from the list.
Syntax:
There is 1 Parameter used in the list remove(obj) method: obj Object to be removed from the given list.
Example:
#method list1 = ['TOM', 'JOHN', 'ALICE', 'BOB'] list1.remove('TOM'); print ("List : ", list1) list1.remove('BOB'); print ("List : ", list1)
Comments are closed.