Python List remove method with Example – Python Tutorial
11 months ago Lalit Bhagtani 0
In this tutorial, we will learn about python list remove method.
remove method :
This method is used to remove ( delete ) the first occurrence of an element ( item ) passed as an argument from the list object.
Syntax : < List Object >.remove( item )
# create list object and assign it to variable l l = ['a','b','c','d','e','a'] # call remove() method by passing 'a' as an argument l.remove('a') # print the list, to check its elements print(l)
That’s all for Python List remove method. If you liked it, please share your thoughts in comments section and share it with others too.