Yurttas/PL/SL/python/docs/core-python-programming/doc/16/lib/rng-objects.html

Revision as of 19:19, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="navigation"> {| width="100%" cellspacing="2" align="center" | yurttas/PL/SL/python/docs/core-python-programming/doc/16/lib/module-whrandom.html|[[Image:yurt...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


5.3.1 The Random Number Generator Interface

The Random Number Generator interface describes the methods which are available for all random number generators. This will be enhanced in future releases of Python.

In this release of Python, the modules random, whrandom, and instances of the whrandom.whrandom class all conform to this interface.

choice (seq)
Chooses a random element from the non-empty sequence seq and returns it.
randint (a, b)
Returns a random integer N such that a <= N <= b.
random ()
Returns the next random floating point number in the range [0.0 ... 1.0).
uniform (a, b)
Returns a random real number N such that a <= N < b.