fastest method to choose a random element

caca at caca at
Sat Jan 5 17:14:46 CET 2008

On Jan 5, 5:07 pm, c... at wrote:
> Hello, Paul and Arnaud.
> While I think about your answers: do you think there is any way to
> avoid shuffle?
> It may take unnecessary long on a long list most of whose elements
> have the property.

You provide nice answers in the case many elements are picked from the
same list.
Any ideas for the case when the picker is called many times on a
program, but never twice with the same list?

More information about the Python-list mailing list