On Feb 22, 12:54 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Paul Rubin <http://[EMAIL PROTECTED]> 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)

I think you have this backwards.  Should be:

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

or

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

-- Paul
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to