Re: [Tutor] Generating small random integer

2006-02-21 Thread w chun
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().

Re: [Tutor] Generating small random integer

2006-02-20 Thread Danny Yoo
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

[Tutor] Generating small random integer

2006-02-19 Thread Kermit Rose
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]

Re: [Tutor] Generating small random integer

2006-02-19 Thread Adam
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

Re: [Tutor] Generating small random integer

2006-02-19 Thread Kermit Rose
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

Re: [Tutor] Generating small random integer

2006-02-19 Thread Alan Gauld
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

Re: [Tutor] Generating small random integer

2006-02-19 Thread John Fouhy
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

Re: [Tutor] Generating small random integer

2006-02-19 Thread Kermit Rose
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

Re: [Tutor] Generating small random integer

2006-02-19 Thread Alan Gauld
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