Re: [Tutor] Generating small random integer

2006-02-21 Thread Kent Johnson
w chun wrote: >>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

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(). th

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 f

Re: [Tutor] Generating small random integer

2006-02-19 Thread Alan Gauld
> Traceback (most recent call last): > File "", line 1, in -toplevel- >factor0(3737) > File "", line 12, in factor0 >v = transfac(v) > File "", line 19, in transfac >na = na + randint(1,na) > NameError: global name 'randint' is not defined Reading from the bottom uip it tells us th

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

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, inst

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 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

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

[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]> __