Steven D'Aprano wrote: > # Get ten random samples, sampling with replacement. > samples = [random.choice(subset) for i in range(10)] That may include subset items more than once. Use the aptly named random.sample(subset, 10) to avoid that.