Deleting List Elements : List Remove « List « Python






Deleting List Elements

Deleting List Elements
li = ['a', 'b', 'new', 'mpilgrim', 'z', 'example', 'new', 'two', 'elements'] 

print li.remove("z")                                     
print li 

li.remove("new")                                   
print li 

li.remove("z")                                    

print li 
           
       








Related examples in the same category

1.List Delete: delete one item and delete an entire sectionList Delete: delete one item and delete an entire section
2.List: delete an elementList: delete an element
3.List: delete a slice :2List: delete a slice :2
4.Delete an element from a listDelete an element from a list