[Tutor] random numbers

tpc@csua.berkeley.edu tpc@csua.berkeley.edu
Wed May 28 12:58:01 2003


I don't know yet how to generate random numbers in Python, but I think
pseudorandom means generated by a computational process defined
to generate random numbers, as opposed to natural processes, although the
term may be archaic.  You may wish to read:

http://mathworld.wolfram.com/RandomNumber.html

On Wed, 28 May 2003, Jennifer Cianciolo wrote:

> Hi,
>
> I'm having trouble generating random numbers.
>
> if I do
>
> import random
> random.random()
>
> I get
>
> TypeError: 'module' object is not callable
>
> and what I would really like to do is get random integers, but I can't
> do that either.
>
> if I put in
>
> randrange(1, 10)
>
> I get
>
> NameError: name 'randrange' is not defined
>
> but I found that in FAQ
> http://www.python.org/cgi-bin/faqw.py?querytype=anykeywords&casefold=y
> es&req=search&query=random
>
> one more thing - what does it mean that random numbers generated by
> python are 'psuedo' random?  any way to make them not psuedorandom?
>
> thanks in advance
> Jen
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>