List operation: Removing an item

Miguel E miguest66SPAM at SPAMyahoo.com
Mon Apr 17 13:07:10 EDT 2006


Steven D'Aprano wrote:
> On Sat, 15 Apr 2006 22:39:37 -0600, Miguel E. wrote:
> 
> 
>>I am trying to create a function that removes an item as specified by
>>the user. Apparently, the list operation "del list[:]" deletes the
>>entire list. Below is the sample function.
> 
> 
> If you know the value of the item, and not its position:
> 
> somelist.remove("value")
> 
> This will raise an exception if "value" is not in somelist.
> 

Thank you. That fixed it.

Regards,



-M



More information about the Python-list mailing list