Simple - looking for a way to do an element exists check..

Paul Rubin http
Fri Feb 22 13:54:15 EST 2008


Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
>     if any(x==element[0] for x in a): 
>       a.append(element)

Should say:

     if any(x[0]==element[0] for x in a): 
        a.append(element)



More information about the Python-list mailing list