<[EMAIL PROTECTED]> wrote: ... > Rather than writing > > cellboard[0] is not* (cellboard[1] and cellboard[2] and cellboard[3] > and cellboard[4] ... cellboard[8]) > cellboard[1] is not (cellboard[0] and cellboard[2] and cellboard[3] and > cellboard[4] ... cellboard[8])
Urgh... the fastest way to check that a list of N numbers has no duplicates is: if len(set(thelist)) == len(thelist): print 'no duplicates' But if your purpose is to generate N random samples out of a population of M, look at function random.sample (in module random in the Pythons standard library) and you'll do even better!-) Alex -- http://mail.python.org/mailman/listinfo/python-list