blob: b03ac41a59a16d107dabda135611d8b8e4cf71e6 [file] [log] [blame]
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00001\section{Standard Module \sectcode{rand}}
2
3\stmodindex{rand} This module implements a pseudo-random number
4generator with an interface similar to \code{rand()} in C. It defines
5the following functions:
6
7\renewcommand{\indexsubitem}{(in module rand)}
8\begin{funcdesc}{rand}{}
9Returns an integer random number in the range [0 ... 32768).
10\end{funcdesc}
11
12\begin{funcdesc}{choice}{s}
13Returns a random element from the sequence (string, tuple or list)
14\var{s}.
15\end{funcdesc}
16
17\begin{funcdesc}{srand}{seed}
18Initializes the random number generator with the given integral seed.
19When the module is first imported, the random number is initialized with
20the current time.
21\end{funcdesc}