Copyright © tutorialspoint.com
This method removes first obj from the list.
list.remove(obj) |
Here is the detail of parameters:
obj: object to be removed from the list.
It returns none but removes the given object from the list.
#!/usr/bin/python aList = [123, 'xyz', 'zara', 'abc', 'xyz']; aList.remove('xyz'); print "List : ", aList; aList.remove('abc'); print "List : ", aList; |
This will produce following result:
List : [123, 'zara', 'abc', 'xyz'] List : [123, 'zara', 'xyz'] |
Copyright © tutorialspoint.com