newbie : removing recurring element from lists

Andrew Thompson andrew.thompson at
Fri Oct 11 13:52:27 CEST 2002

But then it's not good English!

Maybe we can have 'whilst' to be identical to 'while'!


-----Original Message-----
From: python-list-admin at [mailto:python-list-admin at]
On Behalf Of Mark Rowe
Sent: 11 October 2002 11:15
To: python-list at
Subject: RE: newbie : removing recurring element from lists

On 2002-10-11 11:03:45 +0100 Andrew Thompson 
<andrew.thompson at> wrote:

> Much better to let the machine do the work :
> '
> while aList.__contains__(yourValue):
> 	aList.remove(yourValue)
> '

Its probably a bit cleaner to phrase that as

while yourValue in aList:



More information about the Python-list mailing list