Re: Using the Random Module.

2008-07-12 Thread WDC
On Jul 12, 10:06 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 11 Jul 2008 12:27:32 -0700, castironpi wrote: > > You want a random integer.  Is there a range you want it in? > > > Past a certain point, you'll exceed the granularity of the random number > > generator, a

Re: Using the Random Module.

2008-07-12 Thread Steven D'Aprano
On Fri, 11 Jul 2008 12:27:32 -0700, castironpi wrote: > You want a random integer. Is there a range you want it in? > > Past a certain point, you'll exceed the granularity of the random number > generator, and some values in the range will never be generated. You might want to produce an unboun

Re: Using the Random Module.

2008-07-11 Thread Dan Stromberg
On Fri, 11 Jul 2008 12:27:32 -0700, castironpi wrote: > On Jul 11, 1:29 pm, WDC <[EMAIL PROTECTED]> wrote: >> On Jul 11, 2:15 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote: >> >> > You wrote... >> > >Is there a better way to do that besides doing this: >> >> > random.randint(0

Re: Using the Random Module.

2008-07-11 Thread castironpi
On Jul 11, 1:29 pm, WDC <[EMAIL PROTECTED]> wrote: > On Jul 11, 2:15 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote: > > > You wrote... > > >Is there a better way to do that besides doing this: > > > random.randint(0, 9) > > >09657398671238769 > > > Maybe this? >

Re: Using the Random Module.

2008-07-11 Thread WDC
On Jul 11, 2:15 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote: > You wrote... > >Is there a better way to do that besides doing this: > > random.randint(0, 9) > >09657398671238769 > > Maybe this? > >         random.randint(0, 9e16) > > -- > "The ability of the O

Re: Using the Random Module.

2008-07-11 Thread Michiel Overtoom
You wrote... >Is there a better way to do that besides doing this: > random.randint(0, 9) >09657398671238769 Maybe this? random.randint(0, 9e16) -- "The ability of the OSS process to collect and harness the collective IQ of thousands of individuals

Using the Random Module.

2008-07-11 Thread WDC
I am currently learning, and loving, Python and have a question about random(). Right now, what I have to do to get a whole number and not a decimal using random.random() is this: >>>random.random() 0.84765728501856734 >>>_ * 10**17 84765728501856734.0 Is there a better way to do that besides do