Randomizing in Python

andre.ditador9999 at gmail.com andre.ditador9999 at gmail.com
Sun Mar 4 13:00:41 EST 2007


On Mar 3, 1:56 pm, Mark Nenadov <m... at freelance-developer.com> wrote:
> On Sat, 03 Mar 2007 08:46:09 -0800, andre.ditador9... at gmail.com wrote:
> >      I want to randomize a certain calculation in Python but haven't
> > figured it out yet. To explain what i mean, I' m going to use an
> > example:
> >                         I want to get the numbers to do a random
> > experience database for a game. What would be necessary to do so?
>
> Look into the random module (http://docs.python.org/lib/module-random.html)
>
> random.choice selects a random item out of a sequence
> random.shuffle shuffles a sequence randomly
> random.random gives a random floating point number
>
> --
> Mark Nenadov -> skype: marknenadov, web:http://www.marknenadov.com
> -> "Relying on the government to protect your privacy is like asking a
> peeping tom to install your window blinds." -- John Perry Barlow

Thanks a lot for the help!!!!




More information about the Python-list mailing list