|
Answer» Random numbers are used for fames, simulations, testing, security, and privacy applicatons. Python includes following functions that are commonly used. | Function | Description | | choice(seq) | A random item from a list, tuple, or string. | | randrange ([start,] stop [,Step]) | A randomly selected element from range(start, stop, step) | | random() | A random float, such that 0 is less than or equal to r and r is less than 1 | | seed([x]) | Sets the integer starting value used in generating random numbers. Call this function before calling any other random module function. Returns None. | | shuffle(Ist) | Randomizes the items of a list in plae. Returns None. | | Uniform(x,y) | A random float r, such that x is less than or equal to r and r is less than y |
|