How do I select a random element from an array in Python?

Viewed 123721

The first examples that I googled didn't work. This should be trivial, right?

2 Answers
import random
random.choice (mylist)
import random
random.choice([1, 2, 3])
Related