remove items from list in Python
remove items from list in Python
to remove elements from the list we use remove () inbulit function in Python. remove( ) inbuilt function have one parameter object we have to just give parameter value for removing element from the list. Let’s see its syntax and an example of it.
Syntax :- list.remove( object )
Example :-
- x=['a','r','s']
- x.remove('r')
- print(x)
Comments
Post a Comment