You need to tell python that randint is in the random module.
ie, instead of calling randint(), call random.randint().
now this reminds me of something... and i think i need the help of the
tutors here! :-)
a long time ago, i recall that randint() was deprecated in favor of
randrange().
I did try to read it from cover to cover, but too quickly got into
places where I did not know what it talked about.
Mind if we talk about some of those places? *grin*
We might be able to help explain what the tutorial is trying to say, but
you need to give us an opportunity.
So I am
Hello.
How can I find documentation on the random number generator function.
It's not listed in the math module.
In general, how can I find documentation on any particular function if I
don't know what module it is in?
Kermit[EMAIL PROTECTED]
On 19/02/06, Kermit Rose [EMAIL PROTECTED] wrote:
Hello.How can I find documentation on the random number generator function.It's not listed in the math module.You might want to try the
random module.In general,how can I find documentation on any particular function if I
don't know what module it
From: Adam
Date: 02/19/06 18:25:05
To: Kermit Rose
Cc: tutor@python.org
Subject: Re: [Tutor] Generating small random integer
You might want to try the random module.
*
Why did I get this diagnostic?
factor0(3737)[1, 0, 0, 3737, 1, 1, 3737, 1]
Traceback
How can I find documentation on the random number generator function.
It's not listed in the math module.
Its in the random module.
BTW There are lots of random functions inPython depending on the
algorithm you need.
In general, how can I find documentation on any particular function if I
On 20/02/06, Kermit Rose [EMAIL PROTECTED] wrote:
NameError: global name 'randint' is not defined
In the function that calls randint, I placed the import command.
def transfac(v):
import random
a = v[0]
You need to tell python that randint is in the random module.
ie, instead of
From: John Fouhy
Date: 02/19/06 19:01:26
To: tutor@python.org
Subject: Re: [Tutor] Generating small random integer
You need to tell python that randint is in the random module.
ie, instead of calling randint(), call random.randint().
**
oops. I should have know
Traceback (most recent call last):
File pyshell#50, line 1, in -toplevel-
factor0(3737)
File pyshell#35, line 12, in factor0
v = transfac(v)
File pyshell#48, line 19, in transfac
na = na + randint(1,na)
NameError: global name 'randint' is not defined
Reading from the bottom