I've been using the whrandom.choice routine and it's very
useful. But is there any way to add weights or
probabilities of being chosen to the items in the list?
example:
list=['one','two','three']
item=whrandom.choice(list)
Is there any way to say that 'one' and 'two' have a 25%
chance of being chosen, and 'three' has a 50% chance?
I'm hoping there's already a module to do this... or else
I'll be writing my own..
thanks,
Kevin
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
useful. But is there any way to add weights or
probabilities of being chosen to the items in the list?
example:
list=['one','two','three']
item=whrandom.choice(list)
Is there any way to say that 'one' and 'two' have a 25%
chance of being chosen, and 'three' has a 50% chance?
I'm hoping there's already a module to do this... or else
I'll be writing my own..
thanks,
Kevin
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****