How to make python choose randomly between multiple strings?

python, random

Solution

Add them all to a list, import random, then call the choice method like so:

In [1]: import random
In [2]: hello = ['hi', 'hello', 'yo', 'bonjour', 'hola', 'salaam']
In [3]: random.choice(hello)
Out[3]: 'bonjour'

Problem

How to make python choose randomly between multiple strings?

Original source

Related problems