Python Random Module

Function/MethodDescription
random()Returns a random float in the range [0.0, 1.0).
randint(a, b)Returns a random integer in the range [a, b] (inclusive).
choice(seq)Returns a random element from a sequence seq.
shuffle(seq)Shuffles the elements of a sequence seq in-place.
sample(seq, k)Returns k unique random elements from a sequence seq.
uniform(a, b)Returns a random float in the range [a, b].
seed(x)Initialize the random number generator with a seed value x.
getstate()Returns the internal state of the random number generator.
setstate(state)Sets the internal state of the random number generator using a state object obtained from getstate().