Selecting random values in Python

Опубликовано: 16 June 2026
на канале: Python Morsels
87
10

Python's random module provides utilities for generating pseudorandom numbers. For cryptographically-secure randomness, use the secrets module instead.

Read the article version at: https://pym.dev/random-numbers/

00:00 Generating random integers
00:46 Generating random floating point numbers
01:08 Selecting random items from a sequence
01:47 The random utilities are only pseudorandom
03:27 Cryptographically-secure randomness with the secrets module
04:34 Random and SystemRandom classes
05:20 Use random for pseudo-random numbers and secrets for true randomness

#Python