Note that this site is in currently in version 1.0.0-alpha.   Some functionality may be limited.


The random module or random library allows one to generate random output. The module is useful for to choose a random element from a list, or number from a range, or between two potential values (like True or False).


random module
For a thorough description of the random module, check out the official documentation.


For step-by-step demonstration of how to use random, check out this tutorial from Python For Beginners.

Lessons referring to this term