1.Python choice() 函数
import random print "choice([1, 2, 3, 5, 9]) : ", random.choice([1, 2, 3, 5, 9]) print "choice('A String') : ", random.choice('A String')
输出结果
choice([1, 2, 3, 5, 9]) : 2 choice('A String') : n