5.5 Standard Module rand

   

The rand module simulates the C library's rand() interface, though the results aren't necessarily compatible with any given library's implementation. While still supported for compatibility, the rand module is now considered obsolete; if possible, use the whrandom module instead.

choice (seq)
Returns a random element from the sequence seq.

rand ()
Return a random integer between 0 and 32767, inclusive.

srand (seed)
Set a starting seed value for the random number generator; seed can be an arbitrary integer.

See Also:

whrandom (the standard Python random number generator)



guido@python.org