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

Paul Rubin http
Fri Feb 22 16:38:04 EST 2008


Paul McGuire <ptmcg at austin.rr.com> writes:
> I think you have this backwards.  Should be:
> 
>      if not any(x[0]==element[0] for x in a):
>         a.append(element)

I think you are right, it was too early for me to be reading code when
I posted that ;-)



More information about the Python-list mailing list