Steven D'Aprano <[EMAIL PROTECTED]> writes: > If you want to avoid shuffle, here's an alternative: > > def random_values(n, valuelist=[True, False]): > N = len(valuelist) > for _ in range(N*n): > yield valuelist[random.randrange(0, N)]
That is not guaranteed to yield exactly equal numbers of true and false. -- http://mail.python.org/mailman/listinfo/python-list