Python Morsels: Selecting random values in Python (opens in new tab)
Python's random module provides utilities for generating pseudorandom numbers. For cryptographically-secure randomness, use the secrets module instead. Table of contents Generating random integers Generating random floating point numbers Selecting random items from a sequence The random utilities are only pseudorandom Cryptographically-secure randomness with the secrets module Random and SystemRandom classes Use random for pseudo-random numbers and secrets for true randomness Generating rando...
Read the original article