Python 3 - EdDoc

EdDoc: home/built-in_modules/random/random.choice

random.choice()

A function available after importing the built-in random module.
Returns a random value from a container data-type.

arguments:

The identifier name for a container variable.

returns:

a randomly chosen value from the container data-type passed to it.

what it can do:

It randomly selects a character from a string:

>>> random.choice('abcde')
'd'

It randomly selects a value from a tuple or a list:

>>> my_tuple = (5, 4, 3, 2, 1)
>>> random.choice(my_tuple)
4

[Note choice() cannot be used with dictionaries.]