newbie : removing recurring element from lists
Andrew Thompson
andrew.thompson at ashecastle.com
Fri Oct 11 07:52:27 EDT 2002
More information about the Python-list mailing list
Fri Oct 11 07:52:27 EDT 2002
- Previous message (by thread): newbie : removing recurring element from lists
- Next message (by thread): Read-only class definitions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
But then it's not good English! Maybe we can have 'whilst' to be identical to 'while'! Andrew -----Original Message----- From: python-list-admin at python.org [mailto:python-list-admin at python.org] On Behalf Of Mark Rowe Sent: 11 October 2002 11:15 To: python-list at python.org Subject: RE: newbie : removing recurring element from lists On 2002-10-11 11:03:45 +0100 Andrew Thompson <andrew.thompson at ashecastle.com> 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: aList.remove(yourValue) HTH, Mark -- http://mail.python.org/mailman/listinfo/python-list
- Previous message (by thread): newbie : removing recurring element from lists
- Next message (by thread): Read-only class definitions?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list