random.randint()

random.randint(a, b) Return a random integer N such that a <= N <= b. Alias for randrange(a, b+1).

random.setstate()

random.setstate(state) state should have been obtained from a previous call to getstate(), and setstate() restores the internal state of the generator to what it was at the time getstate() was called.

random.random()

random.random() Return the next random floating point number in the range [0.0, 1.0).

random.sample()

random.sample(population, k) Return a k length list of unique elements chosen from the population sequence or set. Used for random sampling without replacement. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of

random.seed()

random.seed(a=None, version=2) Initialize the random number generator. If a is omitted or None, the current system time is used. If randomness sources are provided by the operating system, they are used instead of the system time (see the os.urandom() function for details on availability). If a is an int, it is used directly. With version 2 (the default), a str, bytes, or bytearray object gets converted to an int and all of its bits are used. With version 1, the hash() of a is used instead.

random.getstate()

random.getstate() Return an object capturing the current internal state of the generator. This object can be passed to setstate() to restore the state.

random.normalvariate()

random.normalvariate(mu, sigma) Normal distribution. mu is the mean, and sigma is the standard deviation.

random.paretovariate()

random.paretovariate(alpha) Pareto distribution. alpha is the shape parameter.

random.gauss()

random.gauss(mu, sigma) Gaussian distribution. mu is the mean, and sigma is the standard deviation. This is slightly faster than the normalvariate() function defined below.

random.lognormvariate()

random.lognormvariate(mu, sigma) Log normal distribution. If you take the natural logarithm of this distribution, you’ll get a normal distribution with mean mu and standard deviation sigma. mu can have any value, and sigma must be greater than zero.