[Tutor] Random Numbers

Tim Peters tim.one@home.com
Tue, 3 Apr 2001 19:51:05 -0400


[Rob Andrews]
> Here's a really terse example:
>
> >>> import whrandom
> >>> doh = whrandom.randint(1, 10)
> >>> dog = whrandom.randint(1, 10)
> >>> doh
> 5
> >>> dog
> 7

Please don't use whrandom.  This was a long-standing confusion in the docs
and the code, finally cleared up in 2.1:  whrandom will go away some day.
"random" is what you want.

>>> import random
>>> random.randint(1, 10)
4
>>>