How to make python choose randomly between multiple strings?
Question: How to make python choose randomly between multiple strings?


Answer: 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'
    

