Let's say, as an example, I have the following list:
foo = ['a', 'b', 'c', 'd', 'e']
What is the best way to retrieve an item at random from this list?
Let's say, as an example, I have the following list:
foo = ['a', 'b', 'c', 'd', 'e']
What is the best way to retrieve an item at random from this list?
foo = ['a', 'b', 'c', 'd', 'e']
from random import choice
print choice(foo)