Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python List remove() Method


previous next AddThis Social Bookmark Button


Description:

This method removes first obj from the list.

Syntax:

list.remove(obj)

Parameters:

Here is the detail of parameters:

  • obj: object to be removed from the list.

Return Value:

It returns none but removes the given object from the list.

Example:

#!/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']


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names