[Tutor] ** Newbie ** - Fastest random choice from integers 0 to
Thu, 7 Feb 2002 21:56:01 -0800 (PST)
On Thu, 7 Feb 2002, Remco Gerlich wrote:
> > My guess is:
> > random.randrange( 0, (X+1), 1 )
> > Is this right?
> Apart from the speed, it's about the only right way, since this is a
> standard library function for it, and the other one, random.randint,
> is deprecated (shouldn't be used anymore).
Also, the third parameter --- the "step" --- is set to 1 by default, so
you can simplify your call to:
Good luck to you!