import random foo = ['a', 'b', 'c', 'd', 'e'] print(random.choice(foo))
或
foo = ['a', 'b', 'c', 'd', 'e'] from random import randrange random_index = randrange(0,len(foo)) print foo[random_index]