【发布时间】:2016-09-26 11:32:46
【问题描述】:
我有一个单词列表
count=100
list = ['apple','orange','mango']
对于上面使用随机函数的计数,是否可以选择 40% 的时间苹果、30% 的时间橙色和 30% 的时间芒果?
例如:
for the count=100, 40 times apple, 30 times orange and 30 times mango.
这个选择必须随机发生
【问题讨论】:
标签: python-2.7 random