注意:此方法不同於random.choice()。 例:. import random mylist = ["geeks", "for", "python"] print(random.choices(mylist, weights = [10, 1, 1], k = 5)).
確定! 回上一頁