ID EN
Random

choice

Python 3.11

Return a random element from the non-empty sequence seq. If seq is empty, raises IndexError.

Syntax

PYTHON
random.choice(seq)

See Also

IndexError