Select Random Element From Python List

In this tutorial, we will introduce the best way to select a random element from a python list.

We will use python random package to select.

1. Import library

from random import choice

2. Create a python list

crew_members = ['Steve', 'Lily', 'Miller', 'Tom', 'Bill', 'Jack']

3. Select a random element

d = choice(crew_members)