Roulette wheel

Tim Wintle tim.wintle at teamrubber.com
Wed Mar 4 19:59:52 CET 2009


On Wed, 2009-03-04 at 18:02 +0000, mattia wrote:
> ri = randint(0, len(rw) - 1)
> print("Random index:", rw[ri], ", value:", pop[rw[ri]])

you probably want random.choice(rw)




More information about the Python-list mailing list