September 2026
1051 pages
35h 4m
English
The random module of the standard library generates pseudorandom numbers and provides additional functions for applying random operations to basic data types.
The random module doesn’t generate true random numbers, but pseudorandom numbers. True random numbers are not computable by a computer. A pseudorandom number generator is initialized with an integer and generates a deterministic but apparently random sequence of pseudorandom numbers. This sequence of numbers repeats itself after a certain number of generated random numbers. In the case of the algorithm used by default in Python, this period is 219937 - 1 numbers.
The pseudorandom number generator implemented in random can be initialized using ...
Read now
Unlock full access