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 ;-)