0
0
mirror of https://github.com/python/cpython.git synced 2024-12-01 03:01:36 +01:00
cpython/Doc/lib/librand.tex

22 lines
681 B
TeX
Raw Normal View History

1994-01-02 02:22:07 +01:00
\section{Standard Module \sectcode{rand}}
\stmodindex{rand} This module implements a pseudo-random number
1995-03-13 11:03:32 +01:00
generator with an interface similar to \code{rand()} in C\@. It defines
1994-01-02 02:22:07 +01:00
the following functions:
\renewcommand{\indexsubitem}{(in module rand)}
\begin{funcdesc}{rand}{}
Returns an integer random number in the range [0 ... 32768).
\end{funcdesc}
\begin{funcdesc}{choice}{s}
Returns a random element from the sequence (string, tuple or list)
\var{s}.
\end{funcdesc}
\begin{funcdesc}{srand}{seed}
Initializes the random number generator with the given integral seed.
When the module is first imported, the random number is initialized with
the current time.
\end{funcdesc}