Using the Random Module.

castironpi castironpi at gmail.com
Fri Jul 11 21:27:32 CEST 2008


On Jul 11, 1:29 pm, WDC <ki4... at gmail.com> wrote:
> On Jul 11, 2:15 pm, Michiel Overtoom <mot... at xs4all.nl> wrote:
>
> > You wrote...
> > >Is there a better way to do that besides doing this:
>
> > >>>>random.randint(00000000000000000, 99999999999999999)
> > >09657398671238769
>
> > Maybe this?
>
> >         random.randint(0, 9e16)
>
> > --
> > "The ability of the OSS process to collect and harness
> > the collective IQ of thousands of individuals across
> > the Internet is simply amazing." - Vinod Vallopillilhttp://www.catb.org/~esr/halloween/halloween4.html
>
> That would work yes, but is there a random() function that would do
> that without the attributes? Not trying to be lazy, I just want to
> know if there is a built in way.
>
> Thanks Michiel.

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.



More information about the Python-list mailing list