Here is an example:
randompackage. Then you seed the random number generator with some random integer using
random.seed(). We used a not very random looking
123. Then, the function
random.random()returns a random number drawn from a uniform distribution between 0 and 1.
With this basic random number generator, you can simulate all kinds of
random processes. For example, if you want to simulate a coin toss,
you could use the convention that a random number less than 0.5 means
heads and greater than 0.5 means tails.