number generator

Klaus Alexander Seistrup klaus at seistrup.dk
Sat Mar 10 10:46:07 CET 2007


Raymond Hettinger wrote:

> To make the solutions equi-probable, a simple approach is to
> recursively enumerate all possibilities and then choose one 
> of them with random.choice().

Or create a list using the biased method, then use .shuffle() to 
return another permutation.

Cheers,

-- 
Klaus Alexander Seistrup
Tv-fri medielicensbetaler
http://klaus.seistrup.dk/



More information about the Python-list mailing list