Steven D'Aprano <[EMAIL PROTECTED]> writes: > Ah, I see what you mean... you're reminding me that the Original Poster > seems to want a biased set of almost-but-not-quite-randomly chosen > values, so that random_values(1) must return one each of True and False > and never True, True or False, False.
I thought that was what was specified, "generate n of each of two types". So if n=10 and the two types are true and false, generate 10 trues and 10 falses. random.shuffle is the most direct way to do it but I gave another approach that doesn't use auxiliary space except for a few variables. -- http://mail.python.org/mailman/listinfo/python-list