Assume I have the following list:
foo = [\'a\', \'b\', \'c\', \'d\', \'e\']
What is the simplest way to retrieve an item at random from thi
foo = ['a', 'b', 'c', 'd', 'e'] number_of_samples = 1
In python 2:
random_items = random.sample(population=foo, k=number_of_samples)
In python 3:
random_items = random.choices(population=foo, k=number_of_samples)