Question on lists

Aahz aahz at pythoncraft.com
Wed Jul 28 10:03:30 EDT 2004


In article <VaKNc.126557$od7.8959 at pd7tw3no>,
Elaine Jackson <elainejackson7355 at home.com> wrote:
>
>If x is the given sequence, then
>[x[i] for i in filter(lambda i: i==0 or x[i-1]<>x[i], range(len(x)))]
>is what you want.

Please report to the UnPythonic Activities Committee.  ;-)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"To me vi is Zen.  To use vi is to practice zen.  Every command is a
koan.  Profound to the user, unintelligible to the uninitiated.  You
discover truth everytime you use it."  --reddy at lion.austin.ibm.com



More information about the Python-list mailing list